]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
LayerCleanupMigrationStep is too eager 43/543/1
authorAntti Villberg <antti.villberg@semantum.fi>
Tue, 23 May 2017 11:02:22 +0000 (14:02 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 23 May 2017 20:50:14 +0000 (23:50 +0300)
refs #7241

Change-Id: Ia389c085b09270a9bea5479ffaefbb2eb08a1ef7

bundles/org.simantics.modeling/src/org/simantics/modeling/migration/LayerCleanupMigrationStep.java

index 1c841bad58901c6a4eb00480908477cf943fb69e..c5c983944f882d5d43d6a0e994614e46dd6bdad6 100644 (file)
@@ -77,9 +77,11 @@ public class LayerCleanupMigrationStep implements MigrationStep {
 
                for(Resource model : graph.getObjects(indexRoot, L0.ConsistsOf)) {
                        
-                       for(Resource diagram : ModelingUtils.searchByType(graph, model, DIA.Composite)) {
-                               for(Resource layer : graph.getObjects(diagram, DIA.HasLayer))
-                                       RemoverUtil.remove(graph, layer);
+                       for(Resource diagram : ModelingUtils.searchByTypeShallow(graph, model, DIA.Composite)) {
+                               for(Resource layer : graph.getObjects(diagram, DIA.HasLayer)) {
+                                       if(!graph.isImmutable(layer))
+                                               RemoverUtil.remove(graph, layer);
+                               }
                        }
                        
                }