summaryrefslogtreecommitdiff
path: root/core/java/android/util/ArrayMap.java
diff options
context:
space:
mode:
authorPaul Scovanner <pscovanner@google.com>2019-03-12 18:03:48 +0000
committerPaul Scovanner <pscovanner@google.com>2019-03-12 18:03:48 +0000
commit91ec97056451753d6db55d310fc93fbd93c61cb3 (patch)
treef9e0ae0442395fe2c7c6ab74c350dd939943d1dc /core/java/android/util/ArrayMap.java
parent17d453ea85703a5bc26c0669231be4d6f0d8bbac (diff)
Revert "Checkng upper bound in *Array classes."
This reverts commit 17d453ea85703a5bc26c0669231be4d6f0d8bbac. Reason for revert: b/127750694 Change-Id: I0ffbf0e64109b3ec724e0687a27b231e335f76b4
Diffstat (limited to 'core/java/android/util/ArrayMap.java')
-rw-r--r--core/java/android/util/ArrayMap.java21
1 files changed, 2 insertions, 19 deletions
diff --git a/core/java/android/util/ArrayMap.java b/core/java/android/util/ArrayMap.java
index e2af6f5ed102..436cb4ff7072 100644
--- a/core/java/android/util/ArrayMap.java
+++ b/core/java/android/util/ArrayMap.java
@@ -16,12 +16,12 @@
package android.util;
+import libcore.util.EmptyArray;
+
import android.annotation.UnsupportedAppUsage;
import com.android.internal.util.ArrayUtils;
-import libcore.util.EmptyArray;
-
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Map;
@@ -453,10 +453,6 @@ public final class ArrayMap<K, V> implements Map<K, V> {
* @return Returns the key stored at the given index.
*/
public K keyAt(int index) {
- if (index >= mSize) {
- // The array might be slightly bigger than mSize, in which case, indexing won't fail.
- throw new ArrayIndexOutOfBoundsException(index);
- }
return (K)mArray[index << 1];
}
@@ -466,10 +462,6 @@ public final class ArrayMap<K, V> implements Map<K, V> {
* @return Returns the value stored at the given index.
*/
public V valueAt(int index) {
- if (index >= mSize) {
- // The array might be slightly bigger than mSize, in which case, indexing won't fail.
- throw new ArrayIndexOutOfBoundsException(index);
- }
return (V)mArray[(index << 1) + 1];
}
@@ -480,10 +472,6 @@ public final class ArrayMap<K, V> implements Map<K, V> {
* @return Returns the previous value at the given index.
*/
public V setValueAt(int index, V value) {
- if (index >= mSize) {
- // The array might be slightly bigger than mSize, in which case, indexing won't fail.
- throw new ArrayIndexOutOfBoundsException(index);
- }
index = (index << 1) + 1;
V old = (V)mArray[index];
mArray[index] = value;
@@ -677,11 +665,6 @@ public final class ArrayMap<K, V> implements Map<K, V> {
* @return Returns the value that was stored at this index.
*/
public V removeAt(int index) {
- if (index >= mSize) {
- // The array might be slightly bigger than mSize, in which case, indexing won't fail.
- throw new ArrayIndexOutOfBoundsException(index);
- }
-
final Object old = mArray[(index << 1) + 1];
final int osize = mSize;
final int nsize;