diff options
| author | Paul Scovanner <pscovanner@google.com> | 2019-03-12 18:03:48 +0000 |
|---|---|---|
| committer | Paul Scovanner <pscovanner@google.com> | 2019-03-12 18:03:48 +0000 |
| commit | 91ec97056451753d6db55d310fc93fbd93c61cb3 (patch) | |
| tree | f9e0ae0442395fe2c7c6ab74c350dd939943d1dc /core/java/android/util/SparseArray.java | |
| parent | 17d453ea85703a5bc26c0669231be4d6f0d8bbac (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/SparseArray.java')
| -rw-r--r-- | core/java/android/util/SparseArray.java | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/core/java/android/util/SparseArray.java b/core/java/android/util/SparseArray.java index 67dfb02a0b95..89ea2d35fc2f 100644 --- a/core/java/android/util/SparseArray.java +++ b/core/java/android/util/SparseArray.java @@ -16,11 +16,10 @@ package android.util; -import android.annotation.UnsupportedAppUsage; - import com.android.internal.util.ArrayUtils; import com.android.internal.util.GrowingArrayUtils; +import android.annotation.UnsupportedAppUsage; import libcore.util.EmptyArray; /** @@ -172,10 +171,6 @@ public class SparseArray<E> implements Cloneable { * the behavior is undefined.</p> */ public void 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); - } if (mValues[index] != DELETED) { mValues[index] = DELETED; mGarbage = true; @@ -284,10 +279,6 @@ public class SparseArray<E> implements Cloneable { * the behavior is undefined.</p> */ public int 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); - } if (mGarbage) { gc(); } @@ -311,10 +302,6 @@ public class SparseArray<E> implements Cloneable { */ @SuppressWarnings("unchecked") public E 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); - } if (mGarbage) { gc(); } @@ -330,10 +317,6 @@ public class SparseArray<E> implements Cloneable { * <p>For indices outside of the range <code>0...size()-1</code>, the behavior is undefined.</p> */ public void setValueAt(int index, E value) { - if (index >= mSize) { - // The array might be slightly bigger than mSize, in which case, indexing won't fail. - throw new ArrayIndexOutOfBoundsException(index); - } if (mGarbage) { gc(); } |
