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

Kurchi Hazra kurchi.subhra.hazra at oracle.com
Fri Sep 30 10:08:11 PDT 2011


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

-------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/net-dev/attachments/20110930/329e5501/attachment.html



More information about the net-dev mailing list