RFR JDK-8209173: javac fails with completion exception while reporting an error

Vicente Romero vicente.romero at oracle.com
Fri Aug 24 20:42:41 UTC 2018



On 08/24/2018 04:31 PM, Maurizio Cimadamore wrote:
> Hi,
> the fix looks good. If I understand correctly, the issue was that, 
> since the diagnostic generation ended up with an exception, the 
> diagnostic never really arrived at the speculative attribution 
> handler, which meant it was not reported. Correct?

correct, although at the end it was not the speculative attribution 
handler the one that was involved here. I mistakingly thought that, it 
was just the default handler, but your still your analysis is correct

>
> Maurizio

thanks for the review
Vicente
>
>
> On 24/08/18 20:52, Vicente Romero wrote:
>> Hi,
>>
>> Please review patch for [1] at [2]. The original issue was reported 
>> for a combination of a Scala class and a client class written in 
>> Java. When the Java class was compiled with javac, it couldn't find 
>> in the class path a class imported by the Scala class, the missing 
>> class belongs to the Scala standard library. The root issue was that 
>> the symbol corresponding to the missing Scala class could not be 
>> completed and a completion exception was thrown. The exception was 
>> fired while javac was producing the corresponding diagnostic error 
>> message. Later on the compiler was swallowing the exception, but the 
>> AST ended up having null fields. This provoked a NPE during a later 
>> compilation phase. The provided test reproduces the issue using Java 
>> classes only.
>>
>> Thanks
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8209173
>> [2] http://cr.openjdk.java.net/~vromero/8209173/webrev.00/
>



More information about the compiler-dev mailing list