X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.objmap2%2Fsrc%2Forg%2Fsimantics%2Fobjmap%2Fgraph%2Frules%2FValueRule.java;h=2e2b81b191abe792826df445f55e548357df888c;hp=9ba9dba11274291b0dadb6664492542bd853951e;hb=0cb9829cf7fbee31bbc952c6313b01e195e8d010;hpb=6838557ccc94ba62e167fe3da59e04629f5cf9f6 diff --git a/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/ValueRule.java b/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/ValueRule.java index 9ba9dba11..2e2b81b19 100644 --- a/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/ValueRule.java +++ b/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/ValueRule.java @@ -13,6 +13,9 @@ package org.simantics.objmap.graph.rules; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + +import java.util.Objects; + import org.simantics.db.ReadGraph; import org.simantics.db.WriteGraph; import org.simantics.objmap.backward.IBackwardMapping; @@ -57,7 +60,14 @@ public class ValueRule implements IBidirectionalMappingRule map, Domain domainElement, + Range rangeElement) throws MappingException { + Object value = rangeAccessor.get(rangeElement); + return !Objects.equals(value, domainAccessor.get(g, domainElement)); + } public void createDomain(WriteGraph g, IBackwardMapping map, Domain domainElement, Range rangeElement) throws MappingException { updateDomain(g, map, domainElement, rangeElement);