diff --git a/src/main/java/net/kemitix/node/NodeItem.java b/src/main/java/net/kemitix/node/NodeItem.java index c3d87f7..86c66ed 100644 --- a/src/main/java/net/kemitix/node/NodeItem.java +++ b/src/main/java/net/kemitix/node/NodeItem.java @@ -208,7 +208,7 @@ class NodeItem implements Node { */ @Override public Node createChild(@NonNull final T child) { - return new NodeItem<>(child, this); + return new NodeItem<>(child, "", this, new HashSet<>()); } @Override diff --git a/src/main/java/net/kemitix/node/Nodes.java b/src/main/java/net/kemitix/node/Nodes.java index 7093c07..0a6fa96 100644 --- a/src/main/java/net/kemitix/node/Nodes.java +++ b/src/main/java/net/kemitix/node/Nodes.java @@ -24,6 +24,7 @@ SOFTWARE. package net.kemitix.node; +import java.util.HashSet; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -47,7 +48,7 @@ public final class Nodes { * @return the new node */ public static Node unnamedRoot(final T data) { - return new NodeItem<>(data); + return new NodeItem<>(data, "", null, new HashSet<>()); } /** @@ -60,7 +61,7 @@ public final class Nodes { * @return the new node */ public static Node namedRoot(final T data, final String name) { - return new NodeItem<>(data, name); + return new NodeItem<>(data, name, null, new HashSet<>()); } /** @@ -73,7 +74,7 @@ public final class Nodes { * @return the new node */ public static Node unnamedChild(final T data, final Node parent) { - return new NodeItem<>(data, parent); + return new NodeItem<>(data, "", parent, new HashSet<>()); } /** @@ -89,7 +90,7 @@ public final class Nodes { public static Node namedChild( final T data, final String name, final Node parent ) { - return new NodeItem<>(data, name, parent); + return new NodeItem<>(data, name, parent, new HashSet<>()); } /**