From: Robert Varga Date: Wed, 9 Apr 2014 03:39:58 +0000 (+0200) Subject: BUG-509: Fix a constructor typo/thinko X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~256 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=f2439a364be2129ab6d50eb15ad2df1a0ecac21f;hp=ef6bd770f1366f84fdbc7ab19fa649953b36197b BUG-509: Fix a constructor typo/thinko The 'nested' array should be initialized as empty, but sized for the size of path.getPath(), as we fill it continuously as we traverse the tree. The original initialization also copied path.getPath(), resulting in the path reported in full and then correctly. Change-Id: I9a918ced62a845b985459699e23f1f2f1d55cf35 Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/TreeNodeUtils.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/TreeNodeUtils.java index a2a706a9da..b2ec119ca9 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/TreeNodeUtils.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/TreeNodeUtils.java @@ -43,7 +43,7 @@ public class TreeNodeUtils { public static > T findNodeChecked(final T tree, final InstanceIdentifier path) { T current = tree; - List nested = new ArrayList<>(path.getPath()); + List nested = new ArrayList<>(path.getPath().size()); for(PathArgument pathArg : path.getPath()) { Optional potential = current.getChild(pathArg); nested.add(pathArg);