Certain compilation errors cause internal error in Andy
Some compilation errors can cause an internal error in Andy where Andy does not report the problem as a compilation error but as a missing RunConfiguration. For example:
void test(List<@AlphaChars <@StringLength(int value = 5)String> s){
(there is an extra < and there should not be int before value)
This causes an exception within the compiler:
An exception has occurred in the compiler (17.0.14). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.AssertionError: Unexpected type tree: (ERROR) = 5
at jdk.compiler/com.sun.tools.javac.tree.TreeInfo.typeIn(TreeInfo.java:1268)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.insertAnnotationsToMostInner(JavacParser.java:4666)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseType(JavacParser.java:814)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.typeArgument(JavacParser.java:2146)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.typeArguments(JavacParser.java:2111)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.typeArguments(JavacParser.java:2180)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.typeArgumentsOpt(JavacParser.java:2075)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.term3(JavacParser.java:1434)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.term2(JavacParser.java:929)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.term1(JavacParser.java:900)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.term(JavacParser.java:856)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.term(JavacParser.java:836)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.unannotatedType(JavacParser.java:821)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseType(JavacParser.java:811)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseType(JavacParser.java:807)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.formalParameter(JavacParser.java:4727)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.formalParameters(JavacParser.java:4592)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.formalParameters(JavacParser.java:4584)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.methodDeclaratorRest(JavacParser.java:4467)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.classOrInterfaceOrRecordBodyDeclaration(JavacParser.java:4334)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.classInterfaceOrRecordBody(JavacParser.java:4217)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.classDeclaration(JavacParser.java:3926)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.classOrRecordOrInterfaceOrEnumDeclaration(JavacParser.java:3867)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.typeDeclaration(JavacParser.java:3856)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseCompilationUnit(JavacParser.java:3700)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:620)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:657)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:1006)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:993)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:919)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
at nl.tudelft.cse1110.andy.execution.step.CompilationStep.execute(CompilationStep.java:66)
at nl.tudelft.cse1110.andy.execution.ExecutionFlow.run(ExecutionFlow.java:32)
at nl.tudelft.cse1110.andy.Andy.run(Andy.java:12)
at nl.tudelft.cse1110.andy.AndyOnWebLab.runAndy(AndyOnWebLab.java:43)
at nl.tudelft.cse1110.andy.AndyOnWebLab.main(AndyOnWebLab.java:30)
It is very likely a compiler bug. Minimum working example:
B<@C<@D(e f=
It triggers if a processor is added to the compilation task (even if this processor does nothing).
Hi, since I'm at Oracle it's probably most streamlined if I take over the bug reporting process. Will comment on this issues with any updates. Feel free to assign the ticket to me.
Thanks!
I’ve filed a bug report via the external form, since we’re not sure if I’m allowed to file to JBS directly as a non-author although I have permission to do so.
I expect we’ll get an update in the coming days or weeks.
Issue is on JBS: https://bugs.openjdk.org/browse/JDK-8351260
Someone got assigned to it; seems like the aim is to fix it for 25 (LTS, scheduled for September). If we're lucky we will get backports for older versions of OpenJDK (and thus Coretto benefits from this too), but I wouldn't count on it.