OSDN Git Service

Fixing improper boxing to Integer instead of Long.
authorJozef BABJAK <jozef.babjak@gmail.com>
Mon, 21 Feb 2011 14:55:01 +0000 (15:55 +0100)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 5 Aug 2011 08:10:04 +0000 (16:10 +0800)
This is tricky: entry.getMessageBox() returns int, so it is
by default boxed to Integer. Map.get() however accepts Objects,
so it ignores the difference, but nothing is find during lookup,
just because Long and Integer objects are compared using equals(),
which has to lead to 'false' result. So, explicit boxning to Long
is unnecessary here.

Change-Id: I967a7829a8926410a00274c6b5e312e1af567299

core/java/com/google/android/mms/util/PduCache.java

index 7c3fad7..866ca1e 100644 (file)
@@ -235,7 +235,7 @@ public final class PduCache extends AbstractCache<Uri, PduCacheEntry> {
     }
 
     private void removeFromMessageBoxes(Uri key, PduCacheEntry entry) {
-        HashSet<Uri> msgBox = mThreads.get(entry.getMessageBox());
+        HashSet<Uri> msgBox = mThreads.get(Long.valueOf(entry.getMessageBox()));
         if (msgBox != null) {
             msgBox.remove(key);
         }