- // FIXME: rootNode needs to be a read-write snapshot here...
- final Optional<StoreMetadataNode> newRoot = m.getStrategy().apply(m.getRootModification(), Optional.of(rootNode), StoreUtils.increase(rootNode.getSubtreeVersion()));
- Preconditions.checkState(newRoot.isPresent(), "Apply strategy failed to produce root node");
- return new InMemoryDataTreeCandidate(PUBLIC_ROOT_PATH, root, rootNode, newRoot.get());
+ final Optional<TreeNode> newRoot = m.getStrategy().apply(m.getRootModification(),
+ Optional.<TreeNode>of(rootNode), rootNode.getSubtreeVersion().next());
+ Preconditions.checkState(newRoot.isPresent(), "Apply strategy failed to produce root node");
+ return new InMemoryDataTreeCandidate(PUBLIC_ROOT_PATH, root, rootNode, newRoot.get());