Code Review Request: 6953455 CookieStore.add() cannot handle null URI parameter, contrary to the API specification
Mike Duigou
mike.duigou at oracle.com
Fri Sep 30 10:35:55 PDT 2011
This fix looks correct. I ran into this bug and this is the same fix I believed would fix the problem.
Mike
On Sep 30 2011, at 10:08 , 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
>
More information about the net-dev
mailing list