You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The github actions is done to build with JDK21 first and second with JDK20 to see the difference.
During the compilation of the example project it will emit compilation warnings:
[INFO] --- compiler:3.11.0:compile (default-compile) @ issue-antlr-4.13.0 ---
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 4 source files with javac [debug release 21] to target/classes
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[95,50] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[174,70] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[187,67] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[199,69] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[217,76] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[231,68] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[241,68] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[253,75] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[263,66] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[275,72] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[287,75] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprParser.java:[299,72] possible 'this' escape before subclass is fully initialized
[WARNING] ../issue-antlr-4.13.0/target/generated-sources/antlr4/com/soebes/rpn/grammar/ExprLexer.java:[88,49] possible 'this' escape before subclass is fully initialized
The same code compiles in JDK20.0.1 without WARNING. This implies very likely that it's related to JDK21 itself.
The text was updated successfully, but these errors were encountered:
this-escape is a new linter added in JDK 21, which warns about the constructor calling other methods (with some details).
This is of course a common case in antlr-generated classes. While antlr use @SuppressWarnings("all") for all generated file, this seems only to be a IDE extension, and will be ignored by javac. So compiling program directly with javac will trigger the warning.
During the compilation of the example project it will emit compilation warnings:
The same code compiles in JDK20.0.1 without WARNING. This implies very likely that it's related to JDK21 itself.
The text was updated successfully, but these errors were encountered: