]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/migration/LayerCleanupMigrationStep.java
LayerCleanupMigrationStep is too eager
[simantics/platform.git] / 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);
+                               }
                        }
                        
                }