if(identities.markNew(child))
propagateNewMarks(child);
}
-
+
+ /**
+ * Mark all parents of resources marked new as optional provisionally. This mark is removed
+ * in ValidateGraph.run, if the resource can be found in dependencies.
+ */
+ private void propagateOptionalMarks(int child) {
+ int parent = identities.getParent(child);
+ if(parent >= 0 && !identities.isRoot(parent) && !identities.isNewResource(parent) && identities.markOptional(parent))
+ propagateOptionalMarks(parent);
+ }
+
@Override
public void run() {
- for(int resource : identities.getNewResources())
- propagateNewMarks(resource);
+ int[] originalNewResources = identities.getNewResources();
+ for(int resource : originalNewResources)
+ propagateNewMarks(resource);
+ for(int resource : originalNewResources)
+ propagateOptionalMarks(resource);
}
}