- final Optional<TreeNode> newRoot = m.getStrategy().apply(m.getRootModification(),
- Optional.<TreeNode>of(currentRoot), m.getVersion());
- Preconditions.checkState(newRoot.isPresent(), "Apply strategy failed to produce root node for modification %s", modification);
- return new InMemoryDataTreeCandidate(PUBLIC_ROOT_PATH, root, currentRoot, newRoot.get());
+ final Optional<? extends TreeNode> newRoot = m.getStrategy().apply(m.getRootModification(),
+ Optional.of(currentRoot), m.getVersion());
+ checkState(newRoot.isPresent(), "Apply strategy failed to produce root node for modification %s", modification);
+ return new InMemoryDataTreeCandidate(YangInstanceIdentifier.empty(), root, currentRoot, newRoot.get());
+ }
+
+ private static InMemoryDataTreeModification checkedCast(final DataTreeModification mod) {
+ checkArgument(mod instanceof InMemoryDataTreeModification, "Invalid modification class %s", mod.getClass());
+ return (InMemoryDataTreeModification)mod;