RFR 8054536: sun.security.x509.Extension object may throw NPE for hashCode and equals method

Svetlana Nikandrova svetlana.nikandrova at oracle.com
Fri Jul 15 18:12:17 UTC 2016

Hi Artem,

ok, lets get rid of possible NPE in other methods too:

As for unnecessary try-catch in test I'd prefer to have it to emphasis 
that we are checking for NPE.
I'm not sure about "iff" but let it be, it seems like a right place to 
use it.

Thank you,

On 14.07.2016 19:35, Artem Smotrakov wrote:
> Hi Svetlana,
> I'll leave the main review to an official reviewer, but I have a 
> couple of comments.
> There are a couple of other places in Extension.java where NPE may occur:
> - line 255: I see that "extensionId" is checked for null in other 
> methods, but not in getId()
> - line 200: I see that "extensionValue" is checked for null in other 
> methids, but not in getValue()
> Minor: try-catch is not really necessary.
> I am not sure, but "iff" might mean "if and only if", so it may be not 
> a typo.
> You may want to add @Override to a couple of methods since you update 
> Extension.java
> Artem
> On 07/14/2016 08:19 AM, Svetlana Nikandrova wrote:
>> Hello,
>> please review the fix for:
>> https://bugs.openjdk.java.net/browse/JDK-8054536
>> Webrev:
>> http://cr.openjdk.java.net/~snikandrova/8054536/webrev.00/ 
>> <http://cr.openjdk.java.net/%7Esnikandrova/8054536/webrev.00/>
>> Description:
>> Equals and hasCode methods of Extension use extensionId without prior 
>> check for "null" (+ 1 mistype in equals javadoc).
>> Thank you,
>> Svetlana

More information about the security-dev mailing list