More fixes.

- Fixed: containsKey & containsValue in HashMaps were deprecated for
Object Variants.
- Fixed: HashMap wasn't deleting Keys & Values references when removing
a Object
- Fixed: AVLTreeMap didn't balance properly.
- Changed: EnumMap no longer tries to access SharedSecrets since its
gone in java11
- Added: HashMaps now implement ITrimmable
- Added: AVLTreeSet didn't balance properly
- Fixed: HashMaps & LinkedMaps weren't clearing references properly.
This commit is contained in:
2021-06-24 17:16:36 +02:00
parent c0fef15e64
commit 3b27604258
12 changed files with 27 additions and 10 deletions
@@ -283,7 +283,7 @@ public class HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE imp
@Override
public boolean remove(KEY_TYPE o) {
if(KEY_EQUALS_NULL(o)) return (containsNull ? removeNullIndex() : false);
if(KEY_EQUALS_NULL(o)) return containsNull ? removeNullIndex() : false;
int pos = HashUtil.mix(KEY_TO_HASH(o)) & mask;
KEY_TYPE current = keys[pos];
if(KEY_EQUALS_NULL(current)) return false;
@@ -324,6 +324,8 @@ public class HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE imp
}
protected boolean removeIndex(int pos) {
if(pos == nullIndex) return containsNull ? removeNullIndex() : false;
keys[pos] = EMPTY_KEY_VALUE;
size--;
onNodeRemoved(pos);
shiftKeys(pos);