From dda6acc047f945b2fcaeaa9973f227212bf777da Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 20 Sep 2016 22:17:00 +0100 Subject: [PATCH] Nodes: use new NodeItem constructor --- src/main/java/net/kemitix/node/NodeItem.java | 2 +- src/main/java/net/kemitix/node/Nodes.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) 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<>()); } /**