Remove BindingReflections.getQName(BaseIdentity) 03/106703/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 26 Jun 2023 18:03:02 +0000 (20:03 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 26 Jun 2023 18:47:50 +0000 (20:47 +0200)
All users (including downstreams) have been eliminated, remove this
method.

JIRA: MDSAL-781
Change-Id: I66a7dc55d86be4e863cff675f4feb230c5e4c531
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-spec-util/src/main/java/org/opendaylight/mdsal/binding/spec/reflect/BindingReflections.java
binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/reflect/BindingReflectionsTest.java

index 623385d8658c51906a30874e5fce2b83b639e9d2..08b3f2ba1f7055d59e2f060b2359935a1dab82e1 100644 (file)
@@ -57,11 +57,6 @@ public final class BindingReflections {
         return CLASS_TO_QNAME.getUnchecked(dataType).orElse(null);
     }
 
-    public static @NonNull QName getQName(final BaseIdentity identity) {
-        return CLASS_TO_QNAME.getUnchecked(identity.implementedInterface())
-            .orElseThrow(() -> new IllegalStateException("Failed to resolve QName of " + identity));
-    }
-
     public static QNameModule getQNameModule(final Class<?> clz) {
         if (DataContainer.class.isAssignableFrom(clz) || BaseIdentity.class.isAssignableFrom(clz)
                 || Action.class.isAssignableFrom(clz)) {
index 472f174bfe4fcdfe71c22ead14ebaedbcd244e78..7a9427c83ad34094a891a1c3cef41e2b923b8db1 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.mdsal.binding.spec.reflect;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
@@ -15,7 +14,6 @@ import com.google.common.util.concurrent.ListenableFuture;
 import java.util.List;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -26,16 +24,6 @@ public class BindingReflectionsTest {
     public void testBindingWithDummyObject() throws Exception {
         assertFalse("Should not be RpcType", BindingReflections.isRpcType(DataObject.class));
         assertTrue("Should be BindingClass", BindingReflections.isBindingClass(DataObject.class));
-
-        assertEquals(QName.create("test", "test"), BindingReflections.getQName(TestIdentity.VALUE));
-    }
-
-    interface TestIdentity extends BaseIdentity {
-        QName QNAME = QName.create("test", "test");
-        TestIdentity VALUE = () -> TestIdentity.class;
-
-        @Override
-        Class<? extends TestIdentity> implementedInterface();
     }
 
     static final class TestImplementation implements Augmentation<TestImplementation>, RpcService {
@@ -51,4 +39,4 @@ public class BindingReflectionsTest {
             return TestImplementation.class;
         }
     }
-}
\ No newline at end of file
+}