From a36e233bf6d78776fd17113ab6b866cfb7b5efe5 Mon Sep 17 00:00:00 2001 From: Antti Villberg Date: Tue, 23 May 2017 14:02:22 +0300 Subject: [PATCH] LayerCleanupMigrationStep is too eager refs #7241 Change-Id: Ia389c085b09270a9bea5479ffaefbb2eb08a1ef7 --- .../modeling/migration/LayerCleanupMigrationStep.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); + } } } -- 2.47.1