From 753b37cc1dfed14cadc4835653196e38e7d95838 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 20 Sep 2016 22:24:28 +0100 Subject: [PATCH] NodeItem::insertInPath: clarify local variable name --- src/main/java/net/kemitix/node/NodeItem.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/kemitix/node/NodeItem.java b/src/main/java/net/kemitix/node/NodeItem.java index ea26858..a0c330d 100644 --- a/src/main/java/net/kemitix/node/NodeItem.java +++ b/src/main/java/net/kemitix/node/NodeItem.java @@ -264,9 +264,9 @@ class NodeItem implements Node { if (path.length == 0) { insertChild(nodeItem); } else { - val item = path[0]; - findChildByName(item).orElseGet(() -> new NodeItem<>(null, item, this)) - .insertInPath(nodeItem, Arrays.copyOfRange(path, 1, path.length)); + val nextInPath = path[0]; + findChildByName(nextInPath).orElseGet(() -> new NodeItem<>(null, nextInPath, this, new HashSet<>())) + .insertInPath(nodeItem, Arrays.copyOfRange(path, 1, path.length)); } }