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

Chris Hegarty chris.hegarty at oracle.com
Mon Oct 3 06:23:39 PDT 2011


Thumbs up from me too.

-Chris.

On 30/09/2011 18:35, Mike Duigou wrote:
> 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