Open kriegaex opened 1 year ago
I debugged into AJC, because unfortunately the upstream Eclipse Jave Compiler (ACJ) underneath AJC does not log a full stack trace for the stack overflow error. Here it is:
java.lang.StackOverflowError
at com.querydsl.apt.ExtendedTypeFactory$2.visitBase(ExtendedTypeFactory.java:207)
at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:252)
at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:201)
at org.aspectj.org.eclipse.jdt.internal.compiler.apt.model.TypeVariableImpl.accept(TypeVariableImpl.java:77)
at java.compiler@19.0.1/javax.lang.model.util.AbstractTypeVisitor6.visit(AbstractTypeVisitor6.java:91)
at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:254)
at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:201)
at org.aspectj.org.eclipse.jdt.internal.compiler.apt.model.TypeVariableImpl.accept(TypeVariableImpl.java:77)
at java.compiler@19.0.1/javax.lang.model.util.AbstractTypeVisitor6.visit(AbstractTypeVisitor6.java:91)
at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:254)
at com.querydsl.apt.ExtendedTypeFactory$2.visitTypeVariable(ExtendedTypeFactory.java:201)
(and many more repetitions of the last 4 lines)
It would be interesting to see if that works in plain vanilla ECJ or is AJC-specific. I will try that next after work.
Update (CC @zenbones): I quickly checked during a break, and it definitely is not an AJC problem. The same occurs when compiling the project with plain vanilla ECJ 3.31.0. And also there -proc:none
makes the project compile, but of course in that case no code generation via APT takes place.
Update: Bug ticket https://github.com/eclipse-jdt/eclipse.jdt.core/issues/565 created.
This issue came up in https://github.com/dev-aspectj/aspectj-maven-plugin/issues/108, but it is not a problem concerning the Maven plugin. Instead, it seems to be related to annotation processing (APT) support for AJC:
There is an annotation processor on the classpath, namely
com.querydsl:querydsl-apt:5.0.0-jakarta
. It contains a file META-INF/services/javax.annotation.processing.Processor with the following content:That annotation processor handles the
@jakarta.persistence.MappedSuperclass
annotations found on two classes in the sample repository.While Javac (used by Maven Compiler Plugin) can correctly generate code, it seems as if the annotation processor throws off AJC like this (error message with additional line breaks):
A reproducer is at https://github.com/zenbones/showme. Thanks to @zenbones for reporting the problem.
See also https://github.com/dev-aspectj/aspectj-maven-plugin/issues/108#issuecomment-1328225704 for an AspectJ Maven workaround which can also be applied to the AJC command line: letting Javac take care of annotation processing and then using
-proc:none
for AJC.