RFR: JDK-8226561: javac throws NullPointerException in Check.checkClassOverrideEqualsAndHash

Jonathan Gibbons jonathan.gibbons at oracle.com
Mon Aug 12 20:36:47 UTC 2019


Shouldn't the test cover the 2x2 cases of (equals defined or not, 
hashCode defined or not) ?

-- Jon


On 08/12/2019 01:27 PM, Vicente Romero wrote:
> ping,
>
> Thanks,
> Vicente
>
> On 7/25/19 12:23 PM, Vicente Romero wrote:
>> Please review the fix for [1] at [2]. This patch fixes a NPE produced 
>> at a lint warning checking that a class overriding ::equals should 
>> override ::hashCode too. The thing is that if the class is an 
>> inexistent symbol then the method symbol returned by 
>> Types::implementation is null. The fix is checking for this null case,
>>
>> Thanks,
>> Vicente
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8226561
>> [2] http://cr.openjdk.java.net/~vromero/8226561/webrev.00/
>



More information about the compiler-dev mailing list