From 79170b898a48bd6230752714f50c78ccbcf2f5e1 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 14 Mar 2016 15:40:51 +0000 Subject: [PATCH] NodeItem: initialise children set in field and make final Signed-off-by: Paul Campbell --- src/main/java/net/kemitix/node/NodeItem.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/net/kemitix/node/NodeItem.java b/src/main/java/net/kemitix/node/NodeItem.java index 0751a3e..13efcb5 100644 --- a/src/main/java/net/kemitix/node/NodeItem.java +++ b/src/main/java/net/kemitix/node/NodeItem.java @@ -18,7 +18,7 @@ public class NodeItem implements Node { private Node parent; - private Set> children; + private final Set> children = new HashSet<>(); /** * Creates a root node. @@ -43,7 +43,6 @@ public class NodeItem implements Node { if (parent != null) { setParent(parent); } - this.children = new HashSet<>(); } @Override