From: Antti Villberg Date: Tue, 23 May 2017 11:02:22 +0000 (+0300) Subject: LayerCleanupMigrationStep is too eager X-Git-Tag: v1.28.0~2^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F42%2F542%2F1;p=simantics%2Fplatform.git LayerCleanupMigrationStep is too eager refs #7241 Change-Id: Ia389c085b09270a9bea5479ffaefbb2eb08a1ef7 --- diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/migration/LayerCleanupMigrationStep.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/migration/LayerCleanupMigrationStep.java index 1c841bad5..c5c983944 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/migration/LayerCleanupMigrationStep.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/migration/LayerCleanupMigrationStep.java @@ -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); + } } }