From d0e6769126f134886088fc6bfa80f4d3193df13f Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 25 May 2016 14:23:33 +0100 Subject: [PATCH] NodeItem.insertInPath(): don't hide field '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 4dacfd1..357d040 100644 --- a/src/main/java/net/kemitix/node/NodeItem.java +++ b/src/main/java/net/kemitix/node/NodeItem.java @@ -321,8 +321,8 @@ public class NodeItem implements Node { addChild(nodeItem); return; } - String name = nodeItem.getName(); - final Optional> childNamed = findChildByName(name); + String nodeName = nodeItem.getName(); + final Optional> childNamed = findChildByName(nodeName); if (!childNamed.isPresent()) { // nothing with the same name exists addChild(nodeItem); return; @@ -330,7 +330,7 @@ public class NodeItem implements Node { // we have an existing node with the same name final Node existing = childNamed.get(); if (!existing.isEmpty()) { - throw new NodeException("A non-empty node named '" + name + throw new NodeException("A non-empty node named '" + nodeName + "' already exists here"); } else { existing.setData(nodeItem.getData());