summaryrefslogtreecommitdiff
path: root/core/java/android/util/SparseIntArray.java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-03-12 21:54:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-03-12 21:54:07 +0000
commit5d682a61aeee2f5fef16858c0462928b4c799433 (patch)
treea4fdf91b63641bed09b15a86f51430aab25c1781 /core/java/android/util/SparseIntArray.java
parentc39140f62c7f05b41e2105b13f66c3394623b2cb (diff)
parent91ec97056451753d6db55d310fc93fbd93c61cb3 (diff)
Merge "Revert "Checkng upper bound in *Array classes.""
Diffstat (limited to 'core/java/android/util/SparseIntArray.java')
-rw-r--r--core/java/android/util/SparseIntArray.java19
1 files changed, 3 insertions, 16 deletions
diff --git a/core/java/android/util/SparseIntArray.java b/core/java/android/util/SparseIntArray.java
index c68dc4edcfb7..9e6bad1d9ae0 100644
--- a/core/java/android/util/SparseIntArray.java
+++ b/core/java/android/util/SparseIntArray.java
@@ -16,15 +16,14 @@
package android.util;
-import android.annotation.UnsupportedAppUsage;
-
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.GrowingArrayUtils;
-import libcore.util.EmptyArray;
-
import java.util.Arrays;
+import android.annotation.UnsupportedAppUsage;
+import libcore.util.EmptyArray;
+
/**
* SparseIntArrays map integers to integers. Unlike a normal array of integers,
* there can be gaps in the indices. It is intended to be more memory efficient
@@ -172,10 +171,6 @@ public class SparseIntArray implements Cloneable {
* key.</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);
- }
return mKeys[index];
}
@@ -191,10 +186,6 @@ public class SparseIntArray implements Cloneable {
* associated with the largest key.</p>
*/
public int 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 mValues[index];
}
@@ -202,10 +193,6 @@ public class SparseIntArray implements Cloneable {
* Directly set the value at a particular index.
*/
public void setValueAt(int index, int value) {
- if (index >= mSize) {
- // The array might be slightly bigger than mSize, in which case, indexing won't fail.
- throw new ArrayIndexOutOfBoundsException(index);
- }
mValues[index] = value;
}