]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/validation/ValidateGraph.java
(refs #7563) Mark parents of new resource optional in graph.tg
[simantics/platform.git] / bundles / org.simantics.graph.compiler / src / org / simantics / graph / compiler / internal / validation / ValidateGraph.java
index 13d84bfc21ef8b7f7eb6bda12c60d7a8fd934465..b86991fb6ff59e654adbafacde7bdedae9b4e821 100644 (file)
@@ -94,6 +94,10 @@ public class ValidateGraph implements Runnable {
                                                                        continue;
                                                                }
                                                        }
+                                                       else if(store.identities.isOptionalResource(id)) {
+                                                               if(graph.countOccurences(res) > 1)
+                                                                       store.identities.removeOptionalMark(id);
+                                                       }
                                                        else {
                                                                if(graph.countOccurences(res) <= 1) {
                                                                        emit(id, ValidationMode.ERROR, "Resource " + res + " is not defined in dependencies and it is not marked new in this graph.");