From 02fcef0ae7dfd6e3be43648605238a3cf3155e4b Mon Sep 17 00:00:00 2001 From: Steve Hannah Date: Thu, 14 May 2015 09:09:09 -0700 Subject: [PATCH] Fixed issue with size not being updated in TreeMap upon removal of some nodes. --- .../src/main/java/org/teavm/classlib/java/util/TTreeMap.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java index 9263831d3..7ed9729e8 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java @@ -363,8 +363,8 @@ public class TTreeMap extends TAbstractMap implements TCloneable, TS while (minDepth > 0) { TreeNode node = pathToMin[--minDepth]; node.left = right; - node.fix(); node = node.balance(); + node.fix(); right = node; } min.right = right; @@ -372,6 +372,7 @@ public class TTreeMap extends TAbstractMap implements TCloneable, TS root = min; root.fix(); } + root.fix(); return root.balance(); }