]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileStructuralValueRequest.java
Add missing relation field when computing hashCode/equals
[simantics/platform.git] / bundles / org.simantics.structural2 / src / org / simantics / structural2 / scl / CompileStructuralValueRequest.java
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;