X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FPropertyChange.java;h=b9555484e51481a5d733b41b742cee68a541a562;hb=refs%2Fchanges%2F89%2F3789%2F1;hp=5220736d4259f803da5ed032273c8e6f20d46a56;hpb=a4470f2cf50c3f6d4c586930ccd8eaa55ded25a5;p=simantics%2Finterop.git diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java index 5220736..b955548 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java @@ -81,7 +81,15 @@ public class PropertyChange { if (obj.getClass() != this.getClass()) return false; PropertyChange c = (PropertyChange)obj; - return pair.equals(c.pair); + if (!leftSubject.equals(c.leftSubject)) + return false; + if (!rightSubject.equals(c.rightSubject)) + return false; + if (pair.first != null && pair.first.equals(c.pair.first)) + return true; + if (pair.second != null && pair.second.equals(c.pair.second)) + return true; + return false; } public void apply(WriteGraph graph) throws DatabaseException { @@ -198,6 +206,9 @@ public class PropertyChange { } public void setCustomValue(Object customValue) { + if (applied) { + throw new RuntimeException("Cannot change already applied value"); + } this.customValue = customValue; }