Merge "Memory hog: ImmutableList is appropriate here"
authorTony Tkacik <ttkacik@cisco.com>
Mon, 12 May 2014 14:31:06 +0000 (14:31 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 12 May 2014 14:31:06 +0000 (14:31 +0000)
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaPath.java

index c277d3b8cbb3636c4e93c652ecf6c84a1283feac..51eb64159301e5a4998df1438de97909f6ad9fea 100644 (file)
@@ -7,12 +7,12 @@
  */
 package org.opendaylight.yangtools.yang.model.api;
 
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import org.opendaylight.yangtools.yang.common.QName;
 
+import com.google.common.collect.ImmutableList;
+
 /**
  *
  * Represents unique path to the every node inside the module.
@@ -41,7 +41,7 @@ public class SchemaPath {
      *            relative
      */
     public SchemaPath(final List<QName> path, final boolean absolute) {
-        this.path = Collections.unmodifiableList(new ArrayList<QName>(path));
+        this.path = ImmutableList.copyOf(path);
         this.absolute = absolute;
     }