-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
8
-
generic
-
generic
While fixing 7073631, it was noticed some positions are not being reported
correctly:
test/tools/javac/TryWithResources/DuplicateResourceDecl.java:12: warning: [try] auto-closeable resource MyResource has a member method close() that could throw InterruptedException
try(MyResource c = new MyResource();MyResource c = new MyResource()) {
^
The diagnostics says MyResource but the caret points to "c".
Similarly, it is inconsistent whether "auto-closeable resource" names a class
MyResource or an instance r1.
test/tools/javac/TryWithResources/DuplicateResourceDecl.java:12: error: c is already defined in main(String[])
try(MyResource c = new MyResource();MyResource c = new MyResource()) {
^
test/tools/javac/TryWithResources/DuplicateResourceDecl.java:12: warning: [try] auto-closeable resource MyResource has a member method close() that could throw InterruptedException
try(MyResource c = new MyResource();MyResource c = new MyResource()) {
^
test/tools/javac/TryWithResources/DuplicateResourceDecl.java:17: warning: [try] auto-closeable resource MyResource has a member method close() that could throw InterruptedException
static class MyResource implements AutoCloseable {
^
test/tools/javac/TryWithResources/TwrFlow.java:14: error: exception IOException is never thrown in body of corresponding try statement
} catch (IOException ioe) { // Not reachable
^
>>>>>>>>> message says IOException but caret points to "catch"
correctly:
test/tools/javac/TryWithResources/DuplicateResourceDecl.java:12: warning: [try] auto-closeable resource MyResource has a member method close() that could throw InterruptedException
try(MyResource c = new MyResource();MyResource c = new MyResource()) {
^
The diagnostics says MyResource but the caret points to "c".
Similarly, it is inconsistent whether "auto-closeable resource" names a class
MyResource or an instance r1.
test/tools/javac/TryWithResources/DuplicateResourceDecl.java:12: error: c is already defined in main(String[])
try(MyResource c = new MyResource();MyResource c = new MyResource()) {
^
test/tools/javac/TryWithResources/DuplicateResourceDecl.java:12: warning: [try] auto-closeable resource MyResource has a member method close() that could throw InterruptedException
try(MyResource c = new MyResource();MyResource c = new MyResource()) {
^
test/tools/javac/TryWithResources/DuplicateResourceDecl.java:17: warning: [try] auto-closeable resource MyResource has a member method close() that could throw InterruptedException
static class MyResource implements AutoCloseable {
^
test/tools/javac/TryWithResources/TwrFlow.java:14: error: exception IOException is never thrown in body of corresponding try statement
} catch (IOException ioe) { // Not reachable
^
>>>>>>>>> message says IOException but caret points to "catch"
- relates to
-
JDK-7073631 (javac) javac parser improvements for error position reporting
-
- Closed
-