From: Tuukka Lehtonen Date: Sat, 17 Sep 2016 11:32:15 +0000 (+0300) Subject: Sync git svn branch with SVN repository r33205. X-Git-Tag: v1.25.0~110^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=621bec7;p=simantics%2Fplatform.git Sync git svn branch with SVN repository r33205. refs #6692 refs #6695 --- diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalUtil.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalUtil.java index 9c29290a5..e15f5036d 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalUtil.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalUtil.java @@ -619,15 +619,19 @@ public class TypicalUtil { // Attach the same symbol contributions to the created typical // diagram type as are attached to the model-designated // contribution source diagram type. + boolean clonedIndexRootContribution = false; for (Resource symbolContributionSource : cloneSymbolContributionsFrom) { for (Resource contribution : graph.getObjects(symbolContributionSource, DIA.HasSymbolContribution)) { graph.claim(diagramType, DIA.HasSymbolContribution, contribution); + clonedIndexRootContribution |= graph.isInstanceOf(contribution, DIA.IndexRootSymbolContribution); } } - Resource indexContribution = graph.newResource(); - graph.claim(indexContribution, L0.InstanceOf, DIA.IndexRootSymbolContribution); - graph.claim(diagramType, DIA.HasSymbolContribution, indexContribution); + if (!clonedIndexRootContribution) { + Resource indexContribution = graph.newResource(); + graph.claim(indexContribution, L0.InstanceOf, DIA.IndexRootSymbolContribution); + graph.claim(diagramType, DIA.HasSymbolContribution, indexContribution); + } // Add comment to change set. CommentMetadata cm = graph.getMetadata(CommentMetadata.class); diff --git a/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java b/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java index 40bbc04ed..ba29a654a 100644 --- a/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java +++ b/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java @@ -284,7 +284,9 @@ public class SimanticsPlatform implements LifecycleListener { // Check hash of transferable graph to know whether to update or not. if (platformBundle.getHashcode() == existingBundle.getHashcode()) continue; - System.out.println("Ontology hashcodes does not match! platformBundle" + platformBundle.getName() + ".getHashCode()=" + platformBundle.getHashcode() + " existingBundle" + existingBundle.getName() + ".getHashCode()=" + existingBundle.getHashcode()); + System.out.println("Ontology hashcodes do not match: platform bundle=" + + platformBundle.getVersionedId() + ", hash=" + platformBundle.getHashcode() + + "; existing bundle=" + existingBundle.getVersionedId() + ", hash=" + existingBundle.getHashcode()); reinstallTGs.put(platformBundle, existingBundle); } }