BUG-865: deprecate recursive node instantiation 66/32866/2
authorRobert Varga <robert.varga@pantheon.sk>
Sat, 16 Jan 2016 01:05:31 +0000 (02:05 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 18 Jan 2016 13:06:03 +0000 (13:06 +0000)
Recursive create() method forces a full materialization, which is slow
and not memory-efficient. Lazily-instantiated nodes work equally well
using less memory.

Change-Id: I320f375090df480c1b376f543cb0b00649b44234
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/TreeNodeFactory.java

index e728bfaae2618cc70700a7e1259f71fa5584d74c..05af016687b2dca742d7285224702f43402b86a1 100644 (file)
@@ -94,7 +94,10 @@ public final class TreeNodeFactory {
      * @param data data node
      * @param version data node version
      * @return new AbstractTreeNode instance, covering the data tree provided
+     *
+     * @deprecated Use lazy node initialization via {@link #createTreeNode(NormalizedNode, Version)}.
      */
+    @Deprecated
     public static TreeNode createTreeNodeRecursively(final NormalizedNode<?, ?> data, final Version version) {
         if (data instanceof NormalizedNodeContainer<?, ?, ?>) {
             @SuppressWarnings("unchecked")