summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-02-05 19:39:27 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-05 19:39:27 +0000
commitabc88d0743924441bf7fcd3085e3305b076f5af5 (patch)
tree7ef8c386ab53e152110f977220b89566a7197dac /core/java
parent29039a2bdbadcc427a966f5e7a6021fd424c4266 (diff)
parent967439b4d1151a613058b1439e1e4240cdef28d9 (diff)
downloadframeworks_base-abc88d0743924441bf7fcd3085e3305b076f5af5.zip
frameworks_base-abc88d0743924441bf7fcd3085e3305b076f5af5.tar.gz
frameworks_base-abc88d0743924441bf7fcd3085e3305b076f5af5.tar.bz2
am 967439b4: Merge "Make ArrayMap.EMPTY immutable" into lmp-mr1-dev
* commit '967439b4d1151a613058b1439e1e4240cdef28d9': Make ArrayMap.EMPTY immutable
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/util/ArrayMap.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/util/ArrayMap.java b/core/java/android/util/ArrayMap.java
index 7c9861f..6ed3885 100644
--- a/core/java/android/util/ArrayMap.java
+++ b/core/java/android/util/ArrayMap.java
@@ -255,7 +255,10 @@ public final class ArrayMap<K, V> implements Map<K, V> {
}
private ArrayMap(boolean immutable) {
- mHashes = EmptyArray.INT;
+ // If this is immutable, use the sentinal EMPTY_IMMUTABLE_INTS
+ // instance instead of the usual EmptyArray.INT. The reference
+ // is checked later to see if the array is allowed to grow.
+ mHashes = immutable ? EMPTY_IMMUTABLE_INTS : EmptyArray.INT;
mArray = EmptyArray.OBJECT;
mSize = 0;
}