Loading core/java/android/util/ArraySet.java +34 −16 Original line number Diff line number Diff line Loading @@ -156,6 +156,7 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { synchronized (ArraySet.class) { if (mTwiceBaseCache != null) { final Object[] array = mTwiceBaseCache; try { mArray = array; mTwiceBaseCache = (Object[]) array[0]; mHashes = (int[]) array[1]; Loading @@ -164,12 +165,21 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { if (DEBUG) Log.d(TAG, "Retrieving 2x cache " + mHashes + " now have " + mTwiceBaseCacheSize + " entries"); return; } catch (ClassCastException e) { } // Whoops! Someone trampled the array (probably due to not protecting // their access with a lock). Our cache is corrupt; report and give up. Slog.wtf(TAG, "Found corrupt ArraySet cache: [0]=" + array[0] + " [1]=" + array[1]); mTwiceBaseCache = null; mTwiceBaseCacheSize = 0; } } } else if (size == BASE_SIZE) { synchronized (ArraySet.class) { if (mBaseCache != null) { final Object[] array = mBaseCache; try { mArray = array; mBaseCache = (Object[]) array[0]; mHashes = (int[]) array[1]; Loading @@ -178,6 +188,14 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { if (DEBUG) Log.d(TAG, "Retrieving 1x cache " + mHashes + " now have " + mBaseCacheSize + " entries"); return; } catch (ClassCastException e) { } // Whoops! Someone trampled the array (probably due to not protecting // their access with a lock). Our cache is corrupt; report and give up. Slog.wtf(TAG, "Found corrupt ArraySet cache: [0]=" + array[0] + " [1]=" + array[1]); mBaseCache = null; mBaseCacheSize = 0; } } } Loading Loading
core/java/android/util/ArraySet.java +34 −16 Original line number Diff line number Diff line Loading @@ -156,6 +156,7 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { synchronized (ArraySet.class) { if (mTwiceBaseCache != null) { final Object[] array = mTwiceBaseCache; try { mArray = array; mTwiceBaseCache = (Object[]) array[0]; mHashes = (int[]) array[1]; Loading @@ -164,12 +165,21 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { if (DEBUG) Log.d(TAG, "Retrieving 2x cache " + mHashes + " now have " + mTwiceBaseCacheSize + " entries"); return; } catch (ClassCastException e) { } // Whoops! Someone trampled the array (probably due to not protecting // their access with a lock). Our cache is corrupt; report and give up. Slog.wtf(TAG, "Found corrupt ArraySet cache: [0]=" + array[0] + " [1]=" + array[1]); mTwiceBaseCache = null; mTwiceBaseCacheSize = 0; } } } else if (size == BASE_SIZE) { synchronized (ArraySet.class) { if (mBaseCache != null) { final Object[] array = mBaseCache; try { mArray = array; mBaseCache = (Object[]) array[0]; mHashes = (int[]) array[1]; Loading @@ -178,6 +188,14 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { if (DEBUG) Log.d(TAG, "Retrieving 1x cache " + mHashes + " now have " + mBaseCacheSize + " entries"); return; } catch (ClassCastException e) { } // Whoops! Someone trampled the array (probably due to not protecting // their access with a lock). Our cache is corrupt; report and give up. Slog.wtf(TAG, "Found corrupt ArraySet cache: [0]=" + array[0] + " [1]=" + array[1]); mBaseCache = null; mBaseCacheSize = 0; } } } Loading