diff --git a/Changelog.md b/Changelog.md index c213b63d..448db3ee 100644 --- a/Changelog.md +++ b/Changelog.md @@ -12,6 +12,7 @@ - Added: ImmutableOpenHashMap that is not editable (is linked by default for fast iteration) - Added: Maps can now be created through the interface. - Fixed: Lists.addElements(T...elements) was adding elements at the beginning of a list instead of the end. +- Fixed: Bugs with the AVLTreeSet. And marked bugs with AVLTreeX that are still present. ### Version 0.3.1 - Fixed: containsKey & containsValue in HashMaps were deprecated for Object Variants. diff --git a/README.md b/README.md index fa6acf4a..a911b45b 100644 --- a/README.md +++ b/README.md @@ -57,4 +57,5 @@ do not combine the commands because they can not be executed at the same time. ## Current Down Sides (Random order) - Testing for Sub Maps/Sets/Lists are only in a very basic way tested -- Documentation is only present at the lowest level for most cases and needs a typo fixing. \ No newline at end of file +- Documentation is only present at the lowest level for most cases and needs a typo fixing. +- AVLTreeSet/Map Polling (pollFirst/LastKey) is not working properly. It does not crash just the order is not maintained for whatever reason. Will be fixed very soon. \ No newline at end of file diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template index 75a57327..d6d13071 100644 --- a/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template @@ -790,6 +790,7 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_ protected int compare(KEY_TYPE k, KEY_TYPE v) { return comparator != null ? comparator.compare(k, v) : COMPAREABLE_TO_KEY(k, v);} + /** From CLR */ protected void rotateLeft(Entry KEY_VALUE_GENERIC_TYPE entry) { if(entry != null) { Entry KEY_VALUE_GENERIC_TYPE right = entry.right; @@ -806,6 +807,7 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_ } } + /** From CLR */ protected void rotateRight(Entry KEY_VALUE_GENERIC_TYPE entry) { if(entry != null) { Entry KEY_VALUE_GENERIC_TYPE left = entry.left; @@ -822,6 +824,7 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_ } } + /** From CLR */ protected void fixAfterInsertion(Entry KEY_VALUE_GENERIC_TYPE entry) { while(entry != null) { entry.updateHeight(); @@ -846,6 +849,7 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_ } } + /** From CLR */ protected void fixAfterDeletion(Entry KEY_VALUE_GENERIC_TYPE entry) { if(entry != null) { entry.updateHeight(); diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/interfaces/Map.template b/src/builder/resources/speiger/assets/collections/templates/maps/interfaces/Map.template index fd9f70c3..17353125 100644 --- a/src/builder/resources/speiger/assets/collections/templates/maps/interfaces/Map.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/interfaces/Map.template @@ -509,7 +509,7 @@ public interface MAP KEY_VALUE_GENERIC_TYPE extends Map=0;i--) - { - Assert.assertEquals(TEST_ARRAY[i], map.pollLastIntKey()); - } - Assert.assertEquals(0, map.size()); + Assert.assertEquals(map.pollLastIntKey(), 99); } @Test