Add missing relation field when computing hashCode/equals 68/2568/2
authorjsimomaa <jani.simomaa@gmail.com>
Wed, 19 Dec 2018 06:39:11 +0000 (08:39 +0200)
committerJani Simomaa <jani.simomaa@semantum.fi>
Wed, 19 Dec 2018 07:21:44 +0000 (07:21 +0000)
gitlab #239

Change-Id: Ie263a1183a2141a9257972698f4d849e181ff723

bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileProceduralExpressionValueRequest.java
bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileStructuralValueRequest.java

index b402520d74cbe0bb5487e2d96ed15c35c8196af6..27e4a6f3bee5e5e006ca6be1e9c85f129f29db28 100644 (file)
@@ -63,6 +63,7 @@ public class CompileProceduralExpressionValueRequest extends AbstractCompileStru
     public int hashCode() {
         final int prime = 31;
         int result = 1;
+        result = prime * result + ((relation == null) ? 0 : relation.hashCode());
         result = prime * result + ((componentType == null) ? 0 : componentType.hashCode());
         result = prime * result + ((expression == null) ? 0 : expression.hashCode());
         result = prime * result + ((indexRoot == null) ? 0 : indexRoot.hashCode());
@@ -78,6 +79,11 @@ public class CompileProceduralExpressionValueRequest extends AbstractCompileStru
         if (getClass() != obj.getClass())
             return false;
         CompileProceduralExpressionValueRequest other = (CompileProceduralExpressionValueRequest) obj;
+        if (relation == null) {
+            if (other.relation != null)
+                return false;
+        } else if (!relation.equals(other.relation))
+            return false;
         if (componentType == null) {
             if (other.componentType != null)
                 return false;
index 7a8eb715f26362fdc8726d680e3d485fd340d873..6e9975b68ef09d2207438b728011640fa2f9efdc 100644 (file)
@@ -77,6 +77,7 @@ public class CompileStructuralValueRequest extends AbstractCompileStructuralValu
        public int hashCode() {
                final int prime = 31;
                int result = 1;
+               result = prime * result + ((relation == null) ? 0 : relation.hashCode());
                result = prime * result + ((component == null) ? 0 : component.hashCode());
                result = prime * result + ((literal == null) ? 0 : literal.hashCode());
                return result;
@@ -91,6 +92,11 @@ public class CompileStructuralValueRequest extends AbstractCompileStructuralValu
                if (getClass() != obj.getClass())
                        return false;
                CompileStructuralValueRequest other = (CompileStructuralValueRequest) obj;
+               if (relation == null) {
+                       if (other.relation != null)
+                               return false;
+               } else if (!relation.equals(other.relation))
+                       return false;
                if (component == null) {
                        if (other.component != null)
                                return false;