Closed khmarbaise closed 1 year ago
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.