-
Bug
-
Resolution: Fixed
-
P4
-
6
-
b32
-
x86
-
linux
-
Verified
Spec for java.net.CookieStore says:
---------------------------------------------------------------
boolean removeAll()
Remove all cookies in this cookie store.
Returns:
true if this store changed as a result of the call
---------------------------------------------------------------
However default implementation of this class (sun/net/www/protocol/http/InMemoryCookieStore.java) do not take if store is changed or not:
public boolean removeAll() {
lock.lock();
try {
cookieJar.clear();
domainIndex.clear();
uriIndex.clear();
} finally {
lock.unlock();
}
return true;
}
So implementation is in conflict with specification
Specifically, and empty cookie store should not return true for removeAll, since there is no change as a result of the call.
---------------------------------------------------------------
boolean removeAll()
Remove all cookies in this cookie store.
Returns:
true if this store changed as a result of the call
---------------------------------------------------------------
However default implementation of this class (sun/net/www/protocol/http/InMemoryCookieStore.java) do not take if store is changed or not:
public boolean removeAll() {
lock.lock();
try {
cookieJar.clear();
domainIndex.clear();
uriIndex.clear();
} finally {
lock.unlock();
}
return true;
}
So implementation is in conflict with specification
Specifically, and empty cookie store should not return true for removeAll, since there is no change as a result of the call.