From 594b47d5928699fe5a1d052030c31902964d6cd0 Mon Sep 17 00:00:00 2001 From: Jozef BABJAK Date: Mon, 21 Feb 2011 15:44:06 +0100 Subject: [PATCH] Using proper key for removing object from the map. Stored value was used for map removal instead of key. The error was silently ignore, because remove() method accepts Object type argument and siletly does nothing when no value identified by such key is found. Now proper key is used for removal. i.e. the same as for lookup. Change-Id: I3a61fc219385cd0e7bcd4a33cd6ca23be220efe3 --- core/java/android/net/http/CertificateValidatorCache.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/net/http/CertificateValidatorCache.java b/core/java/android/net/http/CertificateValidatorCache.java index 47661d5e76234..a89f75cc8da0f 100644 --- a/core/java/android/net/http/CertificateValidatorCache.java +++ b/core/java/android/net/http/CertificateValidatorCache.java @@ -137,8 +137,8 @@ class CertificateValidatorCache { if (domain != null && domain.length() != 0) { if (secureHash != null && secureHash.length != 0) { - CacheEntry cacheEntry = (CacheEntry)mCacheMap.get( - new Integer(mBigScrew ^ domain.hashCode())); + final Integer key = new Integer(mBigScrew ^ domain.hashCode()); + CacheEntry cacheEntry = mCacheMap.get(key); if (cacheEntry != null) { if (!cacheEntry.expired()) { rval = cacheEntry.has(domain, secureHash); @@ -148,7 +148,7 @@ class CertificateValidatorCache { } // TODO: debug only! } else { - mCacheMap.remove(cacheEntry); + mCacheMap.remove(key); } } }