diff options
| author | Neil Fuller <nfuller@google.com> | 2018-07-06 16:32:44 +0100 |
|---|---|---|
| committer | Neil Fuller <nfuller@google.com> | 2018-07-06 16:32:44 +0100 |
| commit | 3147288c3bf55f07a81096db1595b247ac4ee65f (patch) | |
| tree | 6c577b0244e7de66554aead8a73eb0b3f84be221 /core/java/android/util/LongArray.java | |
| parent | 36beeefc84ddf6062a862bbc378d2f3719d96c0c (diff) | |
| parent | 7980b19bc8fa1fb0c4b4b3abea891d6e245b3edd (diff) | |
resolve merge conflicts of 7980b19bc8fa1fb0c4b4b3abea891d6e245b3edd to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ica0d3578c6e3fcd17b350f63b4acd471774ac014
Diffstat (limited to 'core/java/android/util/LongArray.java')
| -rw-r--r-- | core/java/android/util/LongArray.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/core/java/android/util/LongArray.java b/core/java/android/util/LongArray.java index fa980966802f..5ed1c8c05cba 100644 --- a/core/java/android/util/LongArray.java +++ b/core/java/android/util/LongArray.java @@ -106,7 +106,7 @@ public class LongArray implements Cloneable { ensureCapacity(1); int rightSegment = mSize - index; mSize++; - checkBounds(index); + ArrayUtils.checkBounds(mSize, index); if (rightSegment != 0) { // Move by 1 all values from the right of 'index' @@ -166,7 +166,7 @@ public class LongArray implements Cloneable { * Returns the value at the specified position in this array. */ public long get(int index) { - checkBounds(index); + ArrayUtils.checkBounds(mSize, index); return mValues[index]; } @@ -174,7 +174,7 @@ public class LongArray implements Cloneable { * Sets the value at the specified position in this array. */ public void set(int index, long value) { - checkBounds(index); + ArrayUtils.checkBounds(mSize, index); mValues[index] = value; } @@ -196,7 +196,7 @@ public class LongArray implements Cloneable { * Removes the value at the specified index from this array. */ public void remove(int index) { - checkBounds(index); + ArrayUtils.checkBounds(mSize, index); System.arraycopy(mValues, index + 1, mValues, index, mSize - index - 1); mSize--; } @@ -215,12 +215,6 @@ public class LongArray implements Cloneable { return Arrays.copyOf(mValues, mSize); } - private void checkBounds(int index) { - if (index < 0 || mSize <= index) { - throw new ArrayIndexOutOfBoundsException(mSize, index); - } - } - /** * Test if each element of {@code a} equals corresponding element from {@code b} */ |
