NodeItem: initialise children set in field and make final
Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
This commit is contained in:
parent
1aa2daf14b
commit
79170b898a
1 changed files with 1 additions and 2 deletions
|
@ -18,7 +18,7 @@ public class NodeItem<T> implements Node<T> {
|
|||
|
||||
private Node<T> parent;
|
||||
|
||||
private Set<Node<T>> children;
|
||||
private final Set<Node<T>> children = new HashSet<>();
|
||||
|
||||
/**
|
||||
* Creates a root node.
|
||||
|
@ -43,7 +43,6 @@ public class NodeItem<T> implements Node<T> {
|
|||
if (parent != null) {
|
||||
setParent(parent);
|
||||
}
|
||||
this.children = new HashSet<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue