Fixed a couple bugs.
-Fixed: TreeMap.subMap().entrySet().remove() wouldn't check primitives properly. -Fixed: SortedMap.sub/tail/headMap were looping into themselves. -Changed: LinkedList.addBulk variable definition was triggering a false positive.
This commit is contained in:
+1
-1
@@ -1778,7 +1778,7 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
|
||||
KEY_TYPE key = entry.ENTRY_KEY();
|
||||
if (!inRange(key)) return false;
|
||||
Node KEY_VALUE_GENERIC_TYPE node = map.findNode(key);
|
||||
if (node != null && VALUE_EQUALS(node.getValue(), entry.getValue())) {
|
||||
if (node != null && VALUE_EQUALS(node.ENTRY_VALUE(), entry.ENTRY_VALUE())) {
|
||||
map.removeNode(node);
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1835,7 +1835,7 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
|
||||
KEY_TYPE key = entry.ENTRY_KEY();
|
||||
if (!inRange(key)) return false;
|
||||
Node KEY_VALUE_GENERIC_TYPE node = map.findNode(key);
|
||||
if (node != null && VALUE_EQUALS(node.getValue(), entry.getValue())) {
|
||||
if (node != null && VALUE_EQUALS(node.ENTRY_VALUE(), entry.ENTRY_VALUE())) {
|
||||
map.removeNode(node);
|
||||
return true;
|
||||
}
|
||||
|
||||
+3
-3
@@ -155,11 +155,11 @@ public interface SORTED_MAP KEY_VALUE_GENERIC_TYPE extends SortedMap<CLASS_TYPE,
|
||||
public VALUE_TYPE LAST_ENTRY_VALUE();
|
||||
|
||||
@Override
|
||||
public default SORTED_MAP KEY_VALUE_GENERIC_TYPE subMap(CLASS_TYPE fromKey, CLASS_TYPE toKey) { return subMap(OBJ_TO_KEY(fromKey), OBJ_TO_KEY(toKey)); }
|
||||
public SORTED_MAP KEY_VALUE_GENERIC_TYPE subMap(CLASS_TYPE fromKey, CLASS_TYPE toKey);
|
||||
@Override
|
||||
public default SORTED_MAP KEY_VALUE_GENERIC_TYPE headMap(CLASS_TYPE toKey) { return headMap(OBJ_TO_KEY(toKey)); }
|
||||
public SORTED_MAP KEY_VALUE_GENERIC_TYPE headMap(CLASS_TYPE toKey);
|
||||
@Override
|
||||
public default SORTED_MAP KEY_VALUE_GENERIC_TYPE tailMap(CLASS_TYPE fromKey) { return tailMap(OBJ_TO_KEY(fromKey)); }
|
||||
public SORTED_MAP KEY_VALUE_GENERIC_TYPE tailMap(CLASS_TYPE fromKey);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user