Fail safe import fixes made by Antti
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / util / DomainProcessor3.java
index bd67680db6704f73bbe3a73d69aaa7774f8d3b5f..7a0a5f06bee35eb5c4eebf87691dd8e8bdf97c3a 100644 (file)
@@ -34,6 +34,7 @@ import org.simantics.db.service.TransferableGraphSupport;
 import org.simantics.graph.db.TransferableGraphSource;
 import org.simantics.layer0.Layer0;
 import org.simantics.scl.runtime.function.Function1;
+import org.simantics.utils.datastructures.Pair;
 
 import gnu.trove.list.array.TIntArrayList;
 import gnu.trove.map.hash.TIntIntHashMap;
@@ -504,7 +505,8 @@ public class DomainProcessor3 {
             this.datatypeBinding = Bindings.getBindingUnchecked(Datatype.class);
             this.datatypeSerializer = graph.getService(Databoard.class).getSerializerUnchecked(this.datatypeBinding);
 
-            state.internalEntries = ConsistsOfProcess.walk(graph, status, fringe, exclusions, ignoreVirtual); 
+            Pair<List<InternalEntry>,Set<Resource>> pair = ConsistsOfProcess.walk(graph, status, fringe, exclusions, ignoreVirtual); 
+            state.internalEntries = pair.first;
             
             for(InternalEntry entry : state.internalEntries) {
                Resource r = entry.resource;
@@ -518,6 +520,12 @@ public class DomainProcessor3 {
                 }
             }
 
+            for(Resource unnamedChild : pair.second) {
+                if (status.put(unnamedChild, ExtentStatus.INTERNAL) == null) {
+                    fringe.add(unnamedChild);
+                }
+            }
+            
             if (state.monitor.isCanceled())
                 throw new CancelTransactionException();