RFR: JDK-8198315: Incomplete classpath causes NPE in TransTypes

Jan Lahoda jan.lahoda at oracle.com
Fri May 18 11:02:25 UTC 2018


Hi,

Bug: https://bugs.openjdk.java.net/browse/JDK-8198315

The issue here is that while reporting an error, a missing symbol is 
completed, which then throws CompletionFailure. This CF is caught and 
there's an attempt to report it as an error as well, but as it has the 
same coordinates as the original report, it is skipped as a duplicate. 
So, in the end, neither of these errors gets reported, and the 
compilation continues to backend and javac crashes later.

There are multiple directions for a solution possible, I think:
a) catch and handle the CFs while reporting the error. I tried to 
implement that, but catching the CompletionFailures inside 
RichDiagnosticFormatter didn't seem like a nice solution.
b) make sure the CF throw while reporting the error is reported (by e.g. 
recording the coordinates after error reporting. But in this case, this 
would lead to a worse error messages, so it would be better to avoid 
this option.
c) prevent completing the symbol while reporting the error. This is what 
the proposed patch is trying to do.

Webrev: http://cr.openjdk.java.net/~jlahoda/8198315/webrev.00/

What do you think?

Thanks,
     Jan


More information about the compiler-dev mailing list