-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parsing error: try-with-resources on instance of outer class #8818
Comments
@N1cOs according to the Java specs
keyword For the reference |
Please look at other issues marked with antlr label and hoi they were fixed. There is grammar file in our repo https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/com/puppycrawl/tools/checkstyle/grammar/java.g |
This issue can be closed via #10280 Latest master: ➜ src /usr/lib/jvm/java-16-openjdk/bin/javac Test.java
➜ src cat Test.java
public class Test implements AutoCloseable {
public static void main(String[] args) {
var t = new Test();
t.test();
}
private void test() {
var a = new Abstract() {
@Override
void test() {
try (Test.this) {
System.out.println("Unable to process");
}
}
};
a.test();
}
@Override
public void close() {
}
}
abstract class Abstract {
abstract void test();
}
➜ src cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name = "Checker">
<module name="TreeWalker">
<module name="IllegalTokenText">
</module>
</module>
</module>
➜ src java -jar ~/IdeaProjects/checkstyle/target/checkstyle-9.0-SNAPSHOT-all.jar -c config.xml Test.java
Starting audit...
Audit done.
|
@nmancus1 thanks for update |
$ javac Test.java
$ cat config.xml
$ cat Test.java
$ java $RUN_LOCALE -jar checkstyle-8.36-all.jar -c config.xml Test.java
Expected behaviour: completion without error.
The text was updated successfully, but these errors were encountered: