RFR: 8264258: Unknown lookups in the java package give misleading compilation errors
Jesper Steen Møller
jespersm at openjdk.java.net
Sun Apr 11 13:01:10 UTC 2021
On Sun, 11 Apr 2021 12:49:35 GMT, Jesper Steen Møller <jespersm at openjdk.org> wrote:
> Unknown lookups in the java package give misleading compilation errors
The problem only really occurs for the 'java' package, which is special according to the JLS, since it is always in scope (as per §6.3) and observable (as per §7.4.3). The special handling of unfound symbols in com.sun.tools.javac.comp.Resolve.SymbolNotFoundError.getDiagnostic explcitly handles the issues of unfound classes in unfound packages, and fails to differentiate 'java'.
My research shows that the error was introduced with Jigsaw, see commit 001ebb3a7279d9a193acebc389cbbee867fa5eb3 where the blessed output for TryWithResources/TwrForVariable3.out was changed from "unknown class lang" to "unknown packages java".
-------------
PR: https://git.openjdk.java.net/jdk/pull/3428
More information about the compiler-dev
mailing list