From f5a9f30e0475803a6d2bae07b29ac575bdaf8114 Mon Sep 17 00:00:00 2001 From: serso Date: Sun, 3 Apr 2016 00:46:40 +0200 Subject: [PATCH] TreeMap must be used for variables as they don't implement hashCode --- jscl/src/main/java/jscl/math/Literal.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jscl/src/main/java/jscl/math/Literal.java b/jscl/src/main/java/jscl/math/Literal.java index 66fa9f52..484c0661 100644 --- a/jscl/src/main/java/jscl/math/Literal.java +++ b/jscl/src/main/java/jscl/math/Literal.java @@ -8,7 +8,6 @@ import jscl.mathml.MathML; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.TreeMap; @@ -383,7 +382,7 @@ public class Literal implements Comparable { } Map content(@Nonnull Function c) { - final Map result = new HashMap<>(size); + final Map result = new TreeMap<>(); for (int i = 0; i < size; i++) { result.put(variables[i], c.apply(variables[i]));