Loading core/java/android/util/ArrayMap.java +2 −19 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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]; } Loading @@ -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]; } Loading @@ -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; Loading Loading @@ -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; Loading core/java/android/util/LongSparseArray.java +3 −16 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ import com.android.internal.util.GrowingArrayUtils; import libcore.util.EmptyArray; import java.util.Arrays; import java.util.Objects; /** * SparseArray mapping longs to Objects. Unlike a normal array of Objects, * there can be gaps in the indices. It is intended to be more memory efficient Loading Loading @@ -144,10 +147,6 @@ public class LongSparseArray<E> implements Cloneable { * Removes the mapping at the specified index. */ 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; Loading Loading @@ -237,10 +236,6 @@ public class LongSparseArray<E> implements Cloneable { * key.</p> */ public long 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(); } Loading @@ -261,10 +256,6 @@ public class LongSparseArray<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(); } Loading @@ -278,10 +269,6 @@ public class LongSparseArray<E> implements Cloneable { * LongSparseArray stores. */ 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(); } Loading core/java/android/util/LongSparseLongArray.java +3 −10 Original line number Diff line number Diff line Loading @@ -16,13 +16,14 @@ 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; import java.util.Arrays; /** * Map of {@code long} to {@code long}. Unlike a normal array of longs, there * can be gaps in the indices. It is intended to be more memory efficient than using a Loading Loading @@ -172,10 +173,6 @@ public class LongSparseLongArray implements Cloneable { * key.</p> */ public long 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]; } Loading @@ -191,10 +188,6 @@ public class LongSparseLongArray implements Cloneable { * associated with the largest key.</p> */ public long 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]; } Loading core/java/android/util/SparseArray.java +1 −18 Original line number Diff line number Diff line Loading @@ -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; /** Loading Loading @@ -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; Loading Loading @@ -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(); } Loading @@ -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(); } Loading @@ -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(); } Loading core/java/android/util/SparseBooleanArray.java +1 −18 Original line number Diff line number Diff line Loading @@ -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; /** Loading Loading @@ -168,10 +167,6 @@ public class SparseBooleanArray 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]; } Loading @@ -187,10 +182,6 @@ public class SparseBooleanArray implements Cloneable { * associated with the largest key.</p> */ public boolean 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]; } Loading @@ -198,19 +189,11 @@ public class SparseBooleanArray implements Cloneable { * Directly set the value at a particular index. */ public void setValueAt(int index, boolean 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; } /** @hide */ public void setKeyAt(int index, int key) { if (index >= mSize) { // The array might be slightly bigger than mSize, in which case, indexing won't fail. throw new ArrayIndexOutOfBoundsException(index); } mKeys[index] = key; } Loading Loading
core/java/android/util/ArrayMap.java +2 −19 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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]; } Loading @@ -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]; } Loading @@ -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; Loading Loading @@ -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; Loading
core/java/android/util/LongSparseArray.java +3 −16 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ import com.android.internal.util.GrowingArrayUtils; import libcore.util.EmptyArray; import java.util.Arrays; import java.util.Objects; /** * SparseArray mapping longs to Objects. Unlike a normal array of Objects, * there can be gaps in the indices. It is intended to be more memory efficient Loading Loading @@ -144,10 +147,6 @@ public class LongSparseArray<E> implements Cloneable { * Removes the mapping at the specified index. */ 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; Loading Loading @@ -237,10 +236,6 @@ public class LongSparseArray<E> implements Cloneable { * key.</p> */ public long 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(); } Loading @@ -261,10 +256,6 @@ public class LongSparseArray<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(); } Loading @@ -278,10 +269,6 @@ public class LongSparseArray<E> implements Cloneable { * LongSparseArray stores. */ 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(); } Loading
core/java/android/util/LongSparseLongArray.java +3 −10 Original line number Diff line number Diff line Loading @@ -16,13 +16,14 @@ 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; import java.util.Arrays; /** * Map of {@code long} to {@code long}. Unlike a normal array of longs, there * can be gaps in the indices. It is intended to be more memory efficient than using a Loading Loading @@ -172,10 +173,6 @@ public class LongSparseLongArray implements Cloneable { * key.</p> */ public long 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]; } Loading @@ -191,10 +188,6 @@ public class LongSparseLongArray implements Cloneable { * associated with the largest key.</p> */ public long 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]; } Loading
core/java/android/util/SparseArray.java +1 −18 Original line number Diff line number Diff line Loading @@ -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; /** Loading Loading @@ -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; Loading Loading @@ -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(); } Loading @@ -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(); } Loading @@ -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(); } Loading
core/java/android/util/SparseBooleanArray.java +1 −18 Original line number Diff line number Diff line Loading @@ -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; /** Loading Loading @@ -168,10 +167,6 @@ public class SparseBooleanArray 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]; } Loading @@ -187,10 +182,6 @@ public class SparseBooleanArray implements Cloneable { * associated with the largest key.</p> */ public boolean 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]; } Loading @@ -198,19 +189,11 @@ public class SparseBooleanArray implements Cloneable { * Directly set the value at a particular index. */ public void setValueAt(int index, boolean 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; } /** @hide */ public void setKeyAt(int index, int key) { if (index >= mSize) { // The array might be slightly bigger than mSize, in which case, indexing won't fail. throw new ArrayIndexOutOfBoundsException(index); } mKeys[index] = key; } Loading