From: Reino Ruusu Date: Thu, 15 Aug 2019 12:40:16 +0000 (+0300) Subject: Fixed some issues in objmap2 X-Git-Tag: v1.43.0~136^2~113 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=342a2b006b88330280060c16c2ab50374468a4c6;p=simantics%2Fplatform.git Fixed some issues in objmap2 gitlab #346 Change-Id: I37ca3edb171f5c88f9deac5f03ff29ecf8c28518 --- diff --git a/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/UpdateMethod.java b/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/UpdateMethod.java index 1e2ff4f2d..d26b565b9 100644 --- a/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/UpdateMethod.java +++ b/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/UpdateMethod.java @@ -16,7 +16,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.simantics.objmap.graph.annotations.meta.IsFieldRule; +import org.simantics.objmap.graph.annotations.meta.IsMethodRule; @@ -27,6 +27,6 @@ import org.simantics.objmap.graph.annotations.meta.IsFieldRule; */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) -@IsFieldRule +@IsMethodRule public @interface UpdateMethod { } diff --git a/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/impl/Mapping.java b/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/impl/Mapping.java index 9f048f775..1c44ef930 100644 --- a/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/impl/Mapping.java +++ b/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/impl/Mapping.java @@ -280,9 +280,10 @@ public class Mapping implements IMapping { if(link.type == null) { createDomain(g, link); } - - if(link.type.updateDomain(g, map, link.domainElement, link.rangeElement)) - updated.add(link.domainElement); + else { + if(link.type.updateDomain(g, map, link.domainElement, link.rangeElement)) + updated.add(link.domainElement); + } } if (listensDomain) updateRange(g); //FIXME: without this listening would stop. diff --git a/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/SimpleLinkType.java b/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/SimpleLinkType.java index 1de0e31fa..096d07cb8 100644 --- a/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/SimpleLinkType.java +++ b/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/SimpleLinkType.java @@ -127,7 +127,7 @@ public class SimpleLinkType implements ILinkType { try { LOGGER.info("SimpleLinkType.updateRange " + NameUtils.getSafeName(g, domainElement) + " " + - rangeElement.toString() + (rangeElement.getClass().getName() + "@" + Integer.toHexString(rangeElement.hashCode())) ); } catch(DatabaseException e) { throw new MappingException(e);