summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2013-11-27 17:38:24 -0800
committerAlan Viverette <alanv@google.com>2013-11-27 17:38:24 -0800
commitdb24d142f5202c79128d98cd031be8c34c0731f7 (patch)
tree868bb3dde7475785fce149dfcd8571ffc57c69a5 /core/java/android
parent26606007be1c6e5f0dd57101fc4daeeafe30fc20 (diff)
downloadframeworks_base-db24d142f5202c79128d98cd031be8c34c0731f7.zip
frameworks_base-db24d142f5202c79128d98cd031be8c34c0731f7.tar.gz
frameworks_base-db24d142f5202c79128d98cd031be8c34c0731f7.tar.bz2
Fix LongArray.addAll() to use correct arraycopy argument order
BUG: 11709513 Change-Id: I831e74ccb008739ab315c68618c04f870f9a36a5
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/util/LongArray.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/util/LongArray.java b/core/java/android/util/LongArray.java
index 7d42063..290a89b 100644
--- a/core/java/android/util/LongArray.java
+++ b/core/java/android/util/LongArray.java
@@ -83,7 +83,7 @@ public class LongArray implements Cloneable {
final int count = values.mSize;
ensureCapacity(count);
- System.arraycopy(mValues, mSize, values.mValues, 0, count);
+ System.arraycopy(values.mValues, 0, mValues, mSize, count);
mSize += count;
}
@@ -127,6 +127,9 @@ public class LongArray implements Cloneable {
* Returns the value at the specified position in this array.
*/
public long get(int index) {
+ if (index >= mSize) {
+ throw new ArrayIndexOutOfBoundsException(mSize, index);
+ }
return mValues[index];
}
@@ -148,6 +151,9 @@ public class LongArray implements Cloneable {
* Removes the value at the specified index from this array.
*/
public void remove(int index) {
+ if (index >= mSize) {
+ throw new ArrayIndexOutOfBoundsException(mSize, index);
+ }
System.arraycopy(mValues, index, mValues, index + 1, mSize - index);
}