BUG-865: prune deprecated constructors 56/9156/1
authorRobert Varga <rovarga@cisco.com>
Thu, 17 Jul 2014 22:16:31 +0000 (00:16 +0200)
committerRobert Varga <rovarga@cisco.com>
Thu, 17 Jul 2014 22:16:31 +0000 (00:16 +0200)
This patch removes long-deprecated QName constructors in favor of static
factory methods.

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

index d2ccf637d78ec6096daeb56ddbf2a3b3380ffc76..0ac89ae8da2c1d634d134bc07977877e5a9c4484 100644 (file)
@@ -117,59 +117,6 @@ public final class QName implements Immutable, Serializable, Comparable<QName> {
         return localName;
     }
 
-    /**
-     * QName Constructor.
-     *
-     * @param namespace
-     *            the namespace assigned to the YANG module
-     * @param revision
-     *            the revision of the YANG module
-     * @param localName
-     *            YANG schema identifier
-     *
-     * @deprecated Use {@link #create(URI, Date, String)} instead.
-     */
-    @Deprecated
-    public QName(final URI namespace, final Date revision, final String localName) {
-        this(QNameModule.create(namespace, revision), null, localName);
-    }
-
-    /**
-     * Construct new QName which reuses namespace, revision and prefix from
-     * base.
-     *
-     * @param base
-     * @param localName
-     * @deprecated Use {@link #create(QName, String)} instead.
-     */
-    @Deprecated
-    public QName(final QName base, final String localName) {
-        this(base.getModule(), base.getPrefix(), localName);
-    }
-
-    /**
-     * @deprecated Use {@link #create(String)} instead. This implementation is
-     *             broken.
-     */
-    @Deprecated
-    public QName(final String input) throws ParseException {
-        final String nsAndRev = input.substring(input.indexOf("(") + 1, input.indexOf(")"));
-        final Date revision;
-        final URI namespace;
-        if (nsAndRev.contains("?")) {
-            String[] splitted = nsAndRev.split("\\?");
-            namespace = URI.create(splitted[0]);
-            revision = getRevisionFormat().parse(splitted[1]);
-        } else {
-            namespace = URI.create(nsAndRev);
-            revision = null;
-        }
-
-        this.localName = checkLocalName(input.substring(input.indexOf(")") + 1));
-        this.prefix = null;
-        this.module = QNameModule.create(namespace, revision);
-    }
-
     public static QName create(final String input) {
         Matcher matcher = QNAME_PATTERN_FULL.matcher(input);
         if (matcher.matches()) {
index c4831ef3f2a56b49280ea1e29af96be1bccb6155..002746fa571d8b9616e4ca78ddfd406bcfd005ef 100644 (file)
@@ -123,7 +123,7 @@ public final class BaseTypes {
         }
         final List<QName> pathList = new ArrayList<QName>();
         for (final String path : actualPath) {
-            final QName qname = new QName(namespace, revision, path);
+            final QName qname = QName.create(namespace, revision, path);
             if (qname != null) {
                 pathList.add(qname);
             }