From 342a2b006b88330280060c16c2ab50374468a4c6 Mon Sep 17 00:00:00 2001 From: Reino Ruusu Date: Thu, 15 Aug 2019 15:40:16 +0300 Subject: [PATCH] Fixed some issues in objmap2 gitlab #346 Change-Id: I37ca3edb171f5c88f9deac5f03ff29ecf8c28518 --- .../simantics/objmap/graph/annotations/UpdateMethod.java | 4 ++-- .../src/org/simantics/objmap/graph/impl/Mapping.java | 7 ++++--- .../org/simantics/objmap/graph/schema/SimpleLinkType.java | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) 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); -- 2.47.1