]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Sync git svn branch with SVN repository r33205.
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sat, 17 Sep 2016 11:32:15 +0000 (14:32 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sat, 17 Sep 2016 11:32:15 +0000 (14:32 +0300)
refs #6692
refs #6695

bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalUtil.java
bundles/org.simantics/src/org/simantics/SimanticsPlatform.java

index 9c29290a50e03e2e1da3e01c6afc591aa6b4d9ea..e15f5036d9be684d25fe5f2e7d8b315b229f8b36 100644 (file)
@@ -619,15 +619,19 @@ public class TypicalUtil {
                 // Attach the same symbol contributions to the created typical\r
                 // diagram type as are attached to the model-designated\r
                 // contribution source diagram type.\r
+                boolean clonedIndexRootContribution = false;\r
                 for (Resource symbolContributionSource : cloneSymbolContributionsFrom) {\r
                     for (Resource contribution : graph.getObjects(symbolContributionSource, DIA.HasSymbolContribution)) {\r
                         graph.claim(diagramType, DIA.HasSymbolContribution, contribution);\r
+                        clonedIndexRootContribution |= graph.isInstanceOf(contribution, DIA.IndexRootSymbolContribution);\r
                     }\r
                 }\r
 \r
-                Resource indexContribution = graph.newResource();\r
-                graph.claim(indexContribution, L0.InstanceOf, DIA.IndexRootSymbolContribution);\r
-                graph.claim(diagramType, DIA.HasSymbolContribution, indexContribution);\r
+                if (!clonedIndexRootContribution) {\r
+                    Resource indexContribution = graph.newResource();\r
+                    graph.claim(indexContribution, L0.InstanceOf, DIA.IndexRootSymbolContribution);\r
+                    graph.claim(diagramType, DIA.HasSymbolContribution, indexContribution);\r
+                }\r
 \r
                 // Add comment to change set.\r
                 CommentMetadata cm = graph.getMetadata(CommentMetadata.class);\r
index 40bbc04ed3e7ba70dac8648d5b8aaa6c56458ebc..ba29a654a461370360c61ee399963363ff1e6e7f 100644 (file)
@@ -284,7 +284,9 @@ public class SimanticsPlatform implements LifecycleListener {
                     // Check hash of transferable graph to know whether to update or not.\r
                     if (platformBundle.getHashcode() == existingBundle.getHashcode())\r
                         continue;\r
-                    System.out.println("Ontology hashcodes does not match! platformBundle" + platformBundle.getName() + ".getHashCode()=" + platformBundle.getHashcode() + " existingBundle" + existingBundle.getName() + ".getHashCode()=" + existingBundle.getHashcode());\r
+                    System.out.println("Ontology hashcodes do not match: platform bundle="\r
+                            + platformBundle.getVersionedId() + ", hash=" + platformBundle.getHashcode()\r
+                            + "; existing bundle=" + existingBundle.getVersionedId() + ", hash=" + existingBundle.getHashcode());\r
                     reinstallTGs.put(platformBundle, existingBundle);\r
                 }\r
             }\r