JDK-7086007 : javac fix inconsistent diagnostic messages
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic
  • Submitted: 2011-09-01
  • Updated: 2013-08-02
  • Resolved: 2013-08-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Resolved
Related Reports
Relates :  
Description
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"

Comments
This is no longer an issue and is no longer reproducible.
02-08-2013