Code Review Request: 6953455 CookieStore.add() cannot handle null URI parameter, contrary to the API specification

Neil Richards neil.richards at ngmr.net
Wed Jul 4 07:19:52 PDT 2012


On Fri, 2011-09-30 at 10:08 -0700, Kurchi Hazra wrote:
> 
> 
> Hi,
> 
>     The CookieStore.add() method throws a Null Pointer Exception when
> null is passed as the uri parameter, although this is allowed
> according to the method spec. 
> 
>      The exception is thrown because uri.getHost() is called on a null
> uri in an effort to add it to the uriIndex, one of the hash maps
> constituting the CookieStore. The fix would be to simply bypass adding
> the cookie to the uriIndex when uri is null.
>    
> 
> The fix involves updates in: 
> src/share/classes/java/net/InMemoryCookieStore.java
> 
> Webrev : http://cr.openjdk.java.net/~chegar/6953455/webrev.00/webrev/ 
> 
> Thanks,
> Kurchi
> 

Hi,
This bug fix looks to have been well bedded into the openjdk 8 code
stream at this point.

Would this be a good item to be applied to the jdk7u code stream ?

Regards,
Neil

-- 
Unless stated above:
IBM email: neil_richards at uk.ibm.com
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU




More information about the jdk7u-dev mailing list