From 2807dbd5942a64eb0200de3c2ea0f551a22720f3 Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Mon, 8 Mar 2010 12:04:08 -0500 Subject: [PATCH] If both cookies have null values, use the name difference. Change-Id: Idee9763a14dd559f136ee8b1eea9abaf265d15a1 --- core/java/android/webkit/CookieManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/java/android/webkit/CookieManager.java b/core/java/android/webkit/CookieManager.java index 379b425dc8b19..427ce76150e88 100644 --- a/core/java/android/webkit/CookieManager.java +++ b/core/java/android/webkit/CookieManager.java @@ -219,7 +219,11 @@ public final class CookieManager { // If cookie2 has a null value, it should come later in // the list. if (cookie2.value == null) { - return -1; + // If both cookies have null values, fall back to using the name + // difference. + if (cookie1.value != null) { + return -1; + } } else if (cookie1.value == null) { // Now we know that cookie2 does not have a null value, if // cookie1 has a null value, place it later in the list.