Fix last bug

This commit is contained in:
Clément Fournier
2022-02-11 21:39:16 +01:00
parent c5f4f3cd49
commit f981445f8f
2 changed files with 9 additions and 2 deletions

View File

@ -2406,7 +2406,7 @@ void Resources() :
void Resource() :
{}
{
LOOKAHEAD("this" | Name() ")") (
LOOKAHEAD("this" | Name() (")" | ";")) (
{checkForBadConciseTryWithResourcesUsage();}
Name()
// replaced with Expression in PMD 7, do the bare minimum

View File

@ -2,6 +2,13 @@ public class InputJava9TryWithResources {
public static void main() {
MyResource resource1 = new MyResource();
MyResource resource2 = new MyResource();
try (resource1) { }
try (resource1;) { }
try (resource1; resource2) { }
try (resource1.foo) { }
try (resource1.foo.a) { }
try (resource1.foo.Type v = null) { }
try (this.foo.aa) { }
try (this.foo) { }
}
}
}