BUG-865: remove use of QName.cachedReference() 42/40342/2
authorRobert Varga <rovarga@cisco.com>
Wed, 15 Jun 2016 00:30:37 +0000 (02:30 +0200)
committerRobert Varga <rovarga@cisco.com>
Wed, 15 Jun 2016 08:48:00 +0000 (10:48 +0200)
QName.intern() is the replacement, use that instead.

Change-Id: Iec80feb66561575491a437dbd06d2709a5e7183d
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ConfigConstants.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMRpcImplementationAdapter.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMRpcRoutingTable.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/broker/spi/rpc/RpcRoutingStrategy.java

index 1700062..f3ef5f1 100644 (file)
@@ -16,28 +16,28 @@ public final class ConfigConstants {
     }
 
     private static final QName DUMMY_CONFIG_QNAME = QName.create(
-        "urn:opendaylight:params:xml:ns:yang:controller:config", "2013-04-05", "dummy");
+        "urn:opendaylight:params:xml:ns:yang:controller:config", "2013-04-05", "dummy").intern();
     private static final QName DUMM_RPC_QNAME = QName.create(
-        "urn:ietf:params:xml:ns:yang:rpc-context", "2013-06-17", "dummy");
-    private static final QNameModule CONFIG_MOD = QNameModule.cachedReference(DUMMY_CONFIG_QNAME.getModule());
-    private static final QNameModule RPC_MOD = QNameModule.cachedReference(DUMM_RPC_QNAME.getModule());
+        "urn:ietf:params:xml:ns:yang:rpc-context", "2013-06-17", "dummy").intern();
+    private static final QNameModule CONFIG_MOD = DUMMY_CONFIG_QNAME.getModule();
+    private static final QNameModule RPC_MOD = DUMM_RPC_QNAME.getModule();
 
     public static final String CONFIG_NAMESPACE = CONFIG_MOD.getNamespace().toString();
     public static final String CONFIG_MODULE = "config";
     public static final String CONFIG_THREADS_MODULE = "config-threads";
     public static final String IETF_INET_TYPES = "ietf-inet-types";
 
-    public static final QName SERVICE_TYPE_Q_NAME = createConfigQName("service-type");
-    public static final QName MODULE_TYPE_Q_NAME = createConfigQName("module-type");
-    public static final QName JAVA_CLASS_EXTENSION_QNAME = createConfigQName("java-class");
-    public static final QName DISABLE_OSGI_SERVICE_REG_QNAME = createConfigQName("disable-osgi-service-registration");
-    public static final QName REQUIRED_IDENTITY_EXTENSION_QNAME = createConfigQName("required-identity");
-    public static final QName INNER_STATE_BEAN_EXTENSION_QNAME = createConfigQName("inner-state-bean");
-    public static final QName PROVIDED_SERVICE_EXTENSION_QNAME = createConfigQName("provided-service");
-    public static final QName JAVA_NAME_PREFIX_EXTENSION_QNAME = createConfigQName("java-name-prefix");
-    public static final QName RPC_CONTEXT_REF_GROUPING_QNAME = createRpcXQName("rpc-context-ref");
-    public static final QName RPC_CONTEXT_REF_GROUPING_LEAF = createRpcXQName("context-instance");
-    public static final QName RPC_CONTEXT_INSTANCE_EXTENSION_QNAME = createRpcXQName("rpc-context-instance");
+    public static final QName SERVICE_TYPE_Q_NAME = createConfigQName("service-type").intern();
+    public static final QName MODULE_TYPE_Q_NAME = createConfigQName("module-type").intern();
+    public static final QName JAVA_CLASS_EXTENSION_QNAME = createConfigQName("java-class").intern();
+    public static final QName DISABLE_OSGI_SERVICE_REG_QNAME = createConfigQName("disable-osgi-service-registration").intern();
+    public static final QName REQUIRED_IDENTITY_EXTENSION_QNAME = createConfigQName("required-identity").intern();
+    public static final QName INNER_STATE_BEAN_EXTENSION_QNAME = createConfigQName("inner-state-bean").intern();
+    public static final QName PROVIDED_SERVICE_EXTENSION_QNAME = createConfigQName("provided-service").intern();
+    public static final QName JAVA_NAME_PREFIX_EXTENSION_QNAME = createConfigQName("java-name-prefix").intern();
+    public static final QName RPC_CONTEXT_REF_GROUPING_QNAME = createRpcXQName("rpc-context-ref").intern();
+    public static final QName RPC_CONTEXT_REF_GROUPING_LEAF = createRpcXQName("context-instance").intern();
+    public static final QName RPC_CONTEXT_INSTANCE_EXTENSION_QNAME = createRpcXQName("rpc-context-instance").intern();
 
     public static QName createConfigQName(final String localName) {
         return QName.create(CONFIG_MOD, localName);
index 175b0f3..03f34c7 100644 (file)
@@ -62,7 +62,7 @@ public class BindingDOMRpcImplementationAdapter implements DOMRpcImplementation
 
         this.codec = Preconditions.checkNotNull(codec);
         this.delegate = Preconditions.checkNotNull(delegate);
-        inputQname = QName.cachedReference(QName.create(BindingReflections.getQNameModule(type), "input"));
+        inputQname = QName.create(BindingReflections.getQNameModule(type), "input").intern();
     }
 
     @Override
index 4c6b631..d570041 100644 (file)
@@ -40,7 +40,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 
 final class DOMRpcRoutingTable {
-    private static final QName CONTEXT_REFERENCE = QName.cachedReference(QName.create("urn:opendaylight:yang:extension:yang-ext", "2013-07-09", "context-reference"));
+    private static final QName CONTEXT_REFERENCE = QName.create("urn:opendaylight:yang:extension:yang-ext", "2013-07-09", "context-reference");
 
     static final DOMRpcRoutingTable EMPTY = new DOMRpcRoutingTable();
     private static final Function<AbstractDOMRpcRoutingTableEntry, Set<YangInstanceIdentifier>> EXTRACT_IDENTIFIERS =
index 6c8f37b..f17de22 100644 (file)
@@ -18,8 +18,8 @@ import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 
 public abstract class RpcRoutingStrategy implements Identifiable<QName> {
 
-    private static final QName CONTEXT_REFERENCE = QName.cachedReference(QName.create("urn:opendaylight:yang:extension:yang-ext",
-            "2013-07-09", "context-reference"));
+    private static final QName CONTEXT_REFERENCE = QName.create("urn:opendaylight:yang:extension:yang-ext",
+            "2013-07-09", "context-reference").intern();
     private final QName identifier;
 
     private RpcRoutingStrategy(final QName identifier) {
@@ -126,4 +126,4 @@ public abstract class RpcRoutingStrategy implements Identifiable<QName> {
             throw new UnsupportedOperationException("Non-routed strategy does not have a context");
         }
     }
-}
\ No newline at end of file
+}

©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.