summaryrefslogtreecommitdiffstats
path: root/core/java/android/util
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-02-05 23:16:31 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-05 23:16:31 +0000
commit9a647096ac4f0a2d4a02bd2565872d5121430a95 (patch)
tree4b1face524bf0b42661036ec6d593fa1f44bfcee /core/java/android/util
parent02cc7e2204efe586cfd6b4391ee07d7b7e29fe6a (diff)
parent88c5abb33f0e306a8add10fcef90733aa205799e (diff)
downloadframeworks_base-9a647096ac4f0a2d4a02bd2565872d5121430a95.zip
frameworks_base-9a647096ac4f0a2d4a02bd2565872d5121430a95.tar.gz
frameworks_base-9a647096ac4f0a2d4a02bd2565872d5121430a95.tar.bz2
am 88c5abb3: am 967439b4: Merge "Make ArrayMap.EMPTY immutable" into lmp-mr1-dev automerge: abc88d0
* commit '88c5abb33f0e306a8add10fcef90733aa205799e': Make ArrayMap.EMPTY immutable
Diffstat (limited to 'core/java/android/util')
-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;
}