Code Review Request: 7045655: An empty InMemoryCookieStore should not return true for removeAll
chris.hegarty at oracle.com
Thu Mar 15 12:54:16 PDT 2012
Thanks Kurchi, looks good.
Kurchi Hazra <kurchi.subhra.hazra at oracle.com> wrote:
> Updated webrev: http://cr.openjdk.java.net/~khazra/7045655/webrev.02/
>On 3/15/2012 2:49 AM, Chris Hegarty wrote:
>> Thanks Kurchi, the change look good to me.
>> This is a corner case and already covered by JCK, but it may be useful
>> to amend an existing test to check for this. Maybe
>> CookieStore cookieStore = (new CookieManager()).getCookieStore();
>> + if (cookieStore.removeAll())
>> + fail = true;
>> + checkFail("removeAll on an empty store should return false");
>> On 14/03/12 22:36, Kurchi Hazra wrote:
>>> The CookieStore.removeAll() is supposed to return true according to its
>>> spec, only if the CookieStore changes as a
>>> result of the call.
>>> InMemoryCookieStore:removeAll() was returning true by default, even if
>>> the CookieStore object was already empty,
>>> and no changes were being done by the call. This fix is to simply return
>>> false in case the CookieStore is empty.
>>> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7045655
>>> Webrev: http://cr.openjdk.java.net/~khazra/7045655/webrev.01/
More information about the net-dev