From 621bec7b0f646eb559d24d01183bc8c5c3bbef1a Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Sat, 17 Sep 2016 14:32:15 +0300 Subject: [PATCH] Sync git svn branch with SVN repository r33205. refs #6692 refs #6695 --- .../org/simantics/modeling/typicals/TypicalUtil.java | 10 +++++++--- .../src/org/simantics/SimanticsPlatform.java | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) 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); } } -- 2.43.2