# HG changeset patch # User valeriep # Date 1331847653 25200 # Node ID 1a48716abaa1913e7eb2c80e6f27f239be0a5c41 # Parent 8ad489a789e18872eae49ce63d3f9eb10c36aae0# Parent dd8301ce22b6e9b47beace701a7d7a3db47fed6d Merge diff -r 8ad489a789e1 -r 1a48716abaa1 jdk/make/common/shared/Sanity.gmk --- a/jdk/make/common/shared/Sanity.gmk Thu Mar 15 14:28:48 2012 -0700 +++ b/jdk/make/common/shared/Sanity.gmk Thu Mar 15 14:40:53 2012 -0700 @@ -348,7 +348,13 @@ " Try setting LANG to 'C'. \n" \ "" >> $(WARNING_FILE) ; \ fi +ifeq ($(PLATFORM), macosx) + @if [ "$(LANG)" = "" ]; then \ + $(ECHO) "ERROR: LANG must be set on Mac OS X. Recommended value is \"C\"" >> $(ERROR_FILE) ; \ + fi endif +endif + ###################################################### # Check the Windows cygwin version diff -r 8ad489a789e1 -r 1a48716abaa1 jdk/src/share/classes/java/net/InMemoryCookieStore.java --- a/jdk/src/share/classes/java/net/InMemoryCookieStore.java Thu Mar 15 14:28:48 2012 -0700 +++ b/jdk/src/share/classes/java/net/InMemoryCookieStore.java Thu Mar 15 14:40:53 2012 -0700 @@ -207,6 +207,9 @@ public boolean removeAll() { lock.lock(); try { + if (cookieJar.isEmpty()) { + return false; + } cookieJar.clear(); domainIndex.clear(); uriIndex.clear(); diff -r 8ad489a789e1 -r 1a48716abaa1 jdk/test/java/net/CookieHandler/NullUriCookieTest.java --- a/jdk/test/java/net/CookieHandler/NullUriCookieTest.java Thu Mar 15 14:28:48 2012 -0700 +++ b/jdk/test/java/net/CookieHandler/NullUriCookieTest.java Thu Mar 15 14:40:53 2012 -0700 @@ -23,8 +23,9 @@ /* * @test - * @bug 6953455 + * @bug 6953455 7045655 * @summary CookieStore.add() cannot handle null URI parameter + * and An empty InMemoryCookieStore should not return true for removeAll */ import java.net.CookieManager; @@ -44,6 +45,11 @@ static void checkCookieNullUri() throws Exception { //get a cookie store implementation and add a cookie to the store with null URI CookieStore cookieStore = (new CookieManager()).getCookieStore(); + //Check if removeAll() retrurns false on an empty CookieStore + if (cookieStore.removeAll()) { + fail = true; + } + checkFail("removeAll on empty store should return false"); HttpCookie cookie = new HttpCookie("MY_COOKIE", "MY_COOKIE_VALUE"); cookie.setDomain("foo.com"); cookieStore.add(null, cookie);