Started massive unit testing library these are the first fixes.
-Fixed: AbstractCollection.retainAll didn't push removed values through the consumer. -Fixed: AbstractCollection.toArray wouldn't reset the last entry if the input array was larger then the elements in the collection. -Fixed: SubList didn't check for ranges properly or didn't use parent list to validate changes. -Fixed: ArrayList.addElements didn't check input array fully and used the wrong variable to move the elements around. -Fixed: LinkedList.addElements(EmptyInput) would crash. -Fixed: LinkedList.swapRemove didn't account for if the removed element was the prelast one. -Fixed: LinkedList.removeElements would break the implementation if the list was almost empty and the middle element was removed. -Fixed: LinkedHashSet.addAndMoveToFirst wouldn't move elements to the first place.
This commit is contained in:
+2
@@ -208,6 +208,7 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
||||
}
|
||||
containsNull = true;
|
||||
onNodeAdded(nullIndex);
|
||||
moveToFirstIndex(nullIndex);
|
||||
}
|
||||
else {
|
||||
int pos = HashUtil.mix(KEY_TO_HASH(o)) & mask;
|
||||
@@ -220,6 +221,7 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
||||
}
|
||||
keys[pos] = o;
|
||||
onNodeAdded(pos);
|
||||
moveToFirstIndex(pos);
|
||||
}
|
||||
if(size++ >= maxFill) rehash(HashUtil.arraySize(size+1, loadFactor));
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user