NodeItem: fix up

This commit is contained in:
Paul Campbell 2016-05-24 11:53:13 +01:00
parent 45bd77bbca
commit b456e18316

View file

@ -287,6 +287,10 @@ public class NodeItem<T> implements Node<T> {
public Node<T> createChild(final T child) { public Node<T> createChild(final T child) {
if (child == null) { if (child == null) {
throw new NullPointerException("child"); throw new NullPointerException("child");
}
return new NodeItem<>(child, this);
}
@Override @Override
public Optional<Node<T>> findChildNamed(final String named) { public Optional<Node<T>> findChildNamed(final String named) {
if (named == null) { if (named == null) {
@ -386,8 +390,4 @@ public class NodeItem<T> implements Node<T> {
return name != null && name.length() > 0; return name != null && name.length() > 0;
} }
}
return new NodeItem<>(child, this);
}
} }