BUG-865: remove QName(Module).cachedReference() 36/40336/4
authorRobert Varga <rovarga@cisco.com>
Tue, 14 Jun 2016 23:35:25 +0000 (01:35 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Tue, 21 Jun 2016 11:46:28 +0000 (11:46 +0000)
Deprecated, all users have been removed -> remove.

Change-Id: I408713ed1c80e6e8a5023f18005aff2ab9506ae5
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QName.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QNameModule.java

index 6a8ebe2042184c912a5ccf811cc2cfbb53f4a64b..97a9aaab1ae16d167c0f532572c298b8af65c86d 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.yangtools.yang.common;
 import static org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil.getRevisionFormat;
 
 import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
 import com.google.common.collect.Interner;
 import com.google.common.collect.Interners;
 import java.io.Serializable;
@@ -70,19 +71,6 @@ public final class QName implements Immutable, Serializable, Comparable<QName> {
         this.module = module;
     }
 
-    /**
-     * Look up specified QName in the global cache and return a shared reference.
-     *
-     * @param qname QName instance
-     * @return Cached instance, according to {@link org.opendaylight.yangtools.objcache.ObjectCache} policy.
-     *
-     * @deprecated Use {@link #intern()} instead.
-     */
-    @Deprecated
-    public static QName cachedReference(final QName qname) {
-        return qname.intern();
-    }
-
     /**
      * QName Constructor.
      *
@@ -96,12 +84,8 @@ public final class QName implements Immutable, Serializable, Comparable<QName> {
     }
 
     private static String checkLocalName(final String localName) {
-        if (localName == null) {
-            throw new IllegalArgumentException("Parameter 'localName' may not be null.");
-        }
-        if (localName.length() == 0) {
-            throw new IllegalArgumentException("Parameter 'localName' must be a non-empty string.");
-        }
+        Preconditions.checkArgument(localName != null, "Parameter 'localName' may not be null.");
+               Preconditions.checkArgument(!Strings.isNullOrEmpty(localName), "Parameter 'localName' must be a non-empty string.");
 
         for (final char c : ILLEGAL_CHARACTERS) {
             if (localName.indexOf(c) != -1) {
index 0c786146e67c627fece599041af4545e444fd546..600138faebae12989c839c242ad3cca8b389c58f 100644 (file)
@@ -39,19 +39,6 @@ public final class QNameModule implements Immutable, Serializable {
         this.revision = revision;
     }
 
-    /**
-     * Look up specified module in the global cache and return a shared reference.
-     *
-     * @param module Module instance
-     * @return Cached instance, according to {@link org.opendaylight.yangtools.objcache.ObjectCache} policy.
-     *
-     * @deprecated Use {@link #intern()} instead.
-     */
-    @Deprecated
-    public static QNameModule cachedReference(final QNameModule module) {
-        return module.intern();
-    }
-
     /**
      * Return an interned reference to a equivalent QNameModule.
      *