From: jsimomaa Date: Wed, 19 Dec 2018 06:39:11 +0000 (+0200) Subject: Add missing relation field when computing hashCode/equals X-Git-Tag: v1.43.0~136^2~217 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=e24d6559d29c8926905b2ee16824c5d3c0974f2e;p=simantics%2Fplatform.git Add missing relation field when computing hashCode/equals gitlab #239 Change-Id: Ie263a1183a2141a9257972698f4d849e181ff723 --- diff --git a/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileProceduralExpressionValueRequest.java b/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileProceduralExpressionValueRequest.java index b402520d7..27e4a6f3b 100644 --- a/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileProceduralExpressionValueRequest.java +++ b/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileProceduralExpressionValueRequest.java @@ -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; diff --git a/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileStructuralValueRequest.java b/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileStructuralValueRequest.java index 7a8eb715f..6e9975b68 100644 --- a/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileStructuralValueRequest.java +++ b/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileStructuralValueRequest.java @@ -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;