Remove QNameModule.getRevisionNamespace() 12/92212/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 21 Aug 2020 06:59:03 +0000 (08:59 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 21 Aug 2020 06:59:03 +0000 (08:59 +0200)
This method is not used anywhere and is actually buggy, remove it.

Change-Id: I575b0a6814c80315c5eed26800d61e36bff0798a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QNameModule.java
yang/yang-common/src/test/java/org/opendaylight/yangtools/yang/common/QNameTest.java

index 5da98d990e356e46df2e318eecbae50fee7e77c0..8051db9c08bdab0e92175838e4000f561eec84f9 100644 (file)
@@ -17,7 +17,6 @@ import java.io.DataOutput;
 import java.io.IOException;
 import java.io.Serializable;
 import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.Objects;
 import java.util.Optional;
 import org.eclipse.jdt.annotation.NonNull;
@@ -162,21 +161,6 @@ public final class QNameModule implements Comparable<QNameModule>, Immutable, Se
         return Objects.equals(revision, other.revision) && namespace.equals(other.namespace);
     }
 
-    /**
-     * Returns a namespace in form defined by section 5.6.4. of
-     * <a href=https://tools.ietf.org/html/rfc6020">RFC6020</a>, for example
-     * {@code http://example.acme.com/system?revision=2008-04-01}.
-     *
-     * @return Namespace in form defined by section 5.6.4. of RFC6020.
-     * @throws URISyntaxException on incorrect namespace definition
-     *
-     */
-    @NonNull URI getRevisionNamespace() throws URISyntaxException {
-        final String query = revision == null ? "" : "revision=" + revision.toString();
-        return new URI(namespace.getScheme(), namespace.getUserInfo(), namespace.getHost(), namespace.getPort(),
-            namespace.getPath(), query, namespace.getFragment());
-    }
-
     @Override
     public @NonNull String toString() {
         return MoreObjects.toStringHelper(QNameModule.class).omitNullValues().add("ns", namespace)
index 97a79d19a3a4ad88e325e391394dbc1d13da88ac..dabe8d8944ecad2a466c29a9d1874f396b41daca 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.yangtools.yang.common;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertThrows;
 import static org.junit.Assert.assertTrue;
 
@@ -93,7 +92,6 @@ public class QNameTest {
     @Test
     public void testQNameModule() throws URISyntaxException {
         final QNameModule qnameModule = QNameModule.create(NS, Revision.of("2000-01-01"));
-        assertNotNull(qnameModule.toString());
-        assertNotNull(qnameModule.getRevisionNamespace());
+        assertEquals("QNameModule{ns=urn:foo, rev=2000-01-01}", qnameModule.toString());
     }
 }