RFR (JDK 13/java.xml) 8216408: XMLStreamWriter setDefaultNamespace(null) throws NullPointerException

Joe Wang huizhe.wang at oracle.com
Fri Jan 25 19:34:49 UTC 2019


Hi Daniel,

True, Objects.equals is better. While the default setting generally 
won't be null, it's always good to cover all the bases.

Updated:
http://cr.openjdk.java.net/~joehw/jdk13/8216408/webrev02/

Previous:
http://cr.openjdk.java.net/~joehw/jdk13/8216408/webrev01/

Thanks,
Joe

On 1/25/19, 10:45 AM, Daniel Fuchs wrote:
> Hi Joe,
>
> I was wondering whether:
>
>    return Objects.equals(uri, defaultNamespace)
>
> would be more appropriate (or not) - given the action taken by
> setDefaultNamespace above?
>
> I mean - what if both uri and defaultNamespace are null?
>
> Just double checking - as I have no idea what would be the
> right thing to do :-)
>
> best regards,
>
> -- daniel
>
> On 25/01/2019 17:47, Joe Wang wrote:
>> Please review a fix for XMLStreamWriter.setDefaultNamespace that 
>> throws NullPointerException when the value is null.
>>
>> JBS: https://bugs.openjdk.java.net/browse/JDK-8216408
>> webrevs: http://cr.openjdk.java.net/~joehw/jdk13/8216408/webrev/
>>
>> Thanks,
>> Joe
>>
>


More information about the core-libs-dev mailing list