]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Take rounding field into account in equals and in hashCode 37/4137/1
authorJussi Koskela <jussi.koskela@semantum.fi>
Tue, 14 Apr 2020 07:46:57 +0000 (10:46 +0300)
committerJussi Koskela <jussi.koskela@semantum.fi>
Tue, 14 Apr 2020 07:46:57 +0000 (10:46 +0300)
gitlab #518

Change-Id: If96bc1da15494a6041473ee919a074bf997e2455

bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/rendering/BasicConnectionStyle.java

index 301cfdf092bdabb5ea368c763ada136908e196c6..2f218d8fab325c4c0f7e082a3f977a74fa798486 100644 (file)
@@ -218,6 +218,8 @@ public class BasicConnectionStyle implements ConnectionStyle, Serializable {
         result = prime * result + (int) (temp ^ (temp >>> 32));
         result = prime * result + ((lineColor == null) ? 0 : lineColor.hashCode());
         result = prime * result + ((lineStroke == null) ? 0 : lineStroke.hashCode());
+        temp = Double.doubleToLongBits(rounding);
+        result = prime * result + (int) (temp ^ (temp >>> 32));
         result = prime * result + ((routeLineStroke == null) ? 0 : routeLineStroke.hashCode());
         return result;
     }
@@ -250,6 +252,8 @@ public class BasicConnectionStyle implements ConnectionStyle, Serializable {
                 return false;
         } else if (!lineStroke.equals(other.lineStroke))
             return false;
+        if (Double.doubleToLongBits(rounding) != Double.doubleToLongBits(other.rounding))
+            return false;
         if (routeLineStroke == null) {
             if (other.routeLineStroke != null)
                 return false;