java.lang.StackOverflowError thrown for Q-classes generation #2059

Open
Nogyara opened this Issue Dec 8, 2016 · 2 comments

Projects

None yet

2 participants

@Nogyara
Nogyara commented Dec 8, 2016

Hi guys,

I ran into issue with the newest QueryDSL 4.1.3, when configured as annotation processor for Morphia @Entities in Eclipse 4.6.1. The stack trace follows, but my rough debugging showed that the problem is in generating Q-classes with more complicated type parameters.

In my case, one of the abstract classes looks like this:

public abstract class AbstractEntity<ID extends Comparable<ID> & Serializable> implements Identifiable<ID> {
}

When '& Serializable' is removed, Q-classes generation works again.

java.lang.Exception: java.lang.StackOverflowError
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:169)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
	at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:135)
	at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:915)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:437)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:417)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:368)
	at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.compile(IncrementalImageBuilder.java:330)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:305)
	at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.build(IncrementalImageBuilder.java:135)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildDeltas(JavaBuilder.java:267)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:195)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.StackOverflowError
	at org.eclipse.jdt.internal.compiler.apt.model.TypeVariableImpl.getUpperBound(TypeVariableImpl.java:66)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:220)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:168)
	at org.eclipse.jdt.internal.compiler.apt.model.TypeVariableImpl.accept(TypeVariableImpl.java:74)
	at javax.lang.model.util.AbstractTypeVisitor6.visit(AbstractTypeVisitor6.java:92)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:221)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:168)
	at org.eclipse.jdt.internal.compiler.apt.model.TypeVariableImpl.accept(TypeVariableImpl.java:74)
	at javax.lang.model.util.AbstractTypeVisitor6.visit(AbstractTypeVisitor6.java:92)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:221)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:168)
	at org.eclipse.jdt.internal.compiler.apt.model.TypeVariableImpl.accept(TypeVariableImpl.java:74)
	at javax.lang.model.util.AbstractTypeVisitor6.visit(AbstractTypeVisitor6.java:92)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:221)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:168)
	at org.eclipse.jdt.internal.compiler.apt.model.TypeVariableImpl.accept(TypeVariableImpl.java:74)
	at javax.lang.model.util.AbstractTypeVisitor6.visit(AbstractTypeVisitor6.java:92)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:221)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:168)
	at org.eclipse.jdt.internal.compiler.apt.model.TypeVariableImpl.accept(TypeVariableImpl.java:74)
	at javax.lang.model.util.AbstractTypeVisitor6.visit(AbstractTypeVisitor6.java:92)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:221)
	at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:168)
	at org.eclipse.jdt.internal.compiler.apt.model.TypeVariableImpl.accept(TypeVariableImpl.java:74)
	...
@Shredder121
Member

Just wondering, does this only happen with Eclipse?
Or what do you know more about this issue?

@Nogyara
Nogyara commented Dec 19, 2016

No idea - I only use Eclipse. Judging by the stack trace though, I don't think the issue is Eclipse-specific.
Not sure what more would you like to know - I specified versions involved, stacktrace and a sample entity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment