If we had a data tree that was rooted at a MapEntryNode the
node modification was incorrectly enforcing a MapEntryNode when
trying to write into the dataTree.
Change-Id: I9dc02a1917f38e8a0d62279843974b9869c48693
Signed-off-by: Tomas Cere <tcere@cisco.com>
public Optional<ModificationApplyOperation> getChild(final YangInstanceIdentifier.PathArgument identifier) {
if (identifier instanceof YangInstanceIdentifier.NodeIdentifierWithPredicates) {
return entryStrategy;
+ } else if (entryStrategy.isPresent()) {
+ // In case we already are in a MapEntry node(for example DataTree rooted at MapEntry)
+ // try to retrieve the child that the identifier should be pointing to from our entryStrategy
+ // if we have one. If the entryStrategy cannot find this child we just return the absent
+ // we get from it.
+ return entryStrategy.get().getChild(identifier);
}
return Optional.absent();
}