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

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri May 18 12:16:45 UTC 2018


Looks good. As we discussed offline yesterday I don't think this is 100% 
clear from completion (sometimes directSupertypes on intersections might 
complete too), but it's better than what we had before.

Thanks
Maurizio


On 18/05/18 12:02, Jan Lahoda wrote:
> 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