BUG-868: do not instantiate SchemaPath directly 07/7807/2
authorRobert Varga <rovarga@cisco.com>
Sat, 7 Jun 2014 20:23:34 +0000 (22:23 +0200)
committerRobert Varga <rovarga@cisco.com>
Mon, 9 Jun 2014 07:55:44 +0000 (07:55 +0000)
Switches over to the new APIs, which are more convenient to use and
provide optimization oportunities.

Change-Id: I1d78701ab7e291bc9792cbfc47391ac0608d265f
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryBuilder.java

index 6da8dfc..89f3a4a 100644 (file)
@@ -18,7 +18,6 @@ import com.google.common.base.Optional;
 import com.google.common.collect.Collections2;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -96,14 +95,10 @@ final class ModuleMXBeanEntryBuilder {
     // TODO: the XPath should be parsed by code generator IMO
     private static final String MAGIC_STRING = "MAGIC_STRING";
     private static final String MODULE_CONDITION_XPATH_TEMPLATE = "^/MAGIC_STRING:modules/MAGIC_STRING:module/MAGIC_STRING:type\\s*=\\s*['\"](.+)['\"]$";
-    private static final SchemaPath expectedConfigurationAugmentationSchemaPath = new SchemaPath(
-            Arrays.asList(createConfigQName("modules"),
-                    createConfigQName("module"),
-                    createConfigQName("configuration")), true);
-    private static final SchemaPath expectedStateAugmentationSchemaPath = new SchemaPath(
-            Arrays.asList(createConfigQName("modules"),
-                    createConfigQName("module"), createConfigQName("state")),
-            true);
+    private static final SchemaPath expectedConfigurationAugmentationSchemaPath = SchemaPath.create(true,
+            createConfigQName("modules"), createConfigQName("module"), createConfigQName("configuration"));
+    private static final SchemaPath expectedStateAugmentationSchemaPath = SchemaPath.create(true,
+            createConfigQName("modules"), createConfigQName("module"), createConfigQName("state"));
     private static final Pattern PREFIX_COLON_LOCAL_NAME = Pattern
             .compile("^(.+):(.+)$");
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.