Merge \\"Removed warning when objects are added on wrong order.\\" into nyc-dev am: a98e4512df

am: 620936768f

Change-Id: I6986568b24bb4122452314d412b0f3d6422c61b4
This commit is contained in:
Svetoslav Ganov
2016-06-30 23:44:34 +00:00
committed by android-build-merger

View File

@@ -402,11 +402,14 @@ public final class ArraySet<E> implements Collection<E>, Set<E> {
throw new IllegalStateException("Array is full");
}
if (index > 0 && mHashes[index - 1] > hash) {
RuntimeException e = new RuntimeException("here");
e.fillInStackTrace();
Log.w(TAG, "New hash " + hash
+ " is before end of array hash " + mHashes[index - 1]
+ " at index " + index, e);
// Cannot optimize since it would break the sorted order - fallback to add()
if (DEBUG) {
RuntimeException e = new RuntimeException("here");
e.fillInStackTrace();
Log.w(TAG, "New hash " + hash
+ " is before end of array hash " + mHashes[index - 1]
+ " at index " + index, e);
}
add(value);
return;
}