From: Robert Varga Date: Tue, 14 Jun 2016 23:35:25 +0000 (+0200) Subject: BUG-865: remove QName(Module).cachedReference() X-Git-Tag: release/boron~96 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F40336%2F4;p=yangtools.git BUG-865: remove QName(Module).cachedReference() Deprecated, all users have been removed -> remove. Change-Id: I408713ed1c80e6e8a5023f18005aff2ab9506ae5 Signed-off-by: Robert Varga --- diff --git a/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QName.java b/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QName.java index 6a8ebe2042..97a9aaab1a 100644 --- a/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QName.java +++ b/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QName.java @@ -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 { 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 { } 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) { diff --git a/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QNameModule.java b/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QNameModule.java index 0c786146e6..600138faeb 100644 --- a/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QNameModule.java +++ b/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QNameModule.java @@ -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. *