Remove BindingReflections.isAugmentationChild()
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 2 Nov 2022 14:30:48 +0000 (15:30 +0100)
committerAnil Belur <abelur@linuxfoundation.org>
Wed, 19 Jun 2024 00:41:42 +0000 (10:41 +1000)
This method is not used anywhere, remove it.

JIRA: MDSAL-786
Change-Id: I6ed40aab7432f59e2e2a8bcb51e161cac2fcb33e
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 901e09ba9711c7ded23af0ca6ebbf3e3a8a3e35a..95a5d9a86b61f6ec96ddc39cf7d75e53588cd647 100644 (file)
@@ -207,29 +207,6 @@ public final class BindingReflections {
             .orElseThrow(() -> new IllegalStateException("Failed to resolve QName of " + contract));
     }
 
-    /**
-     * Checks if class is child of augmentation.
-     *
-     * @deprecated This method is unused and scheduled for removal.
-     */
-    @Deprecated(since = "10.0.3", forRemoval = true)
-    public static boolean isAugmentationChild(final Class<?> clazz) {
-        // FIXME: Current resolver could be still confused when child node was added by grouping
-        checkArgument(clazz != null);
-
-        @SuppressWarnings({ "rawtypes", "unchecked" })
-        Class<?> parent = findHierarchicalParent((Class) clazz);
-        if (parent == null) {
-            LOG.debug("Did not find a parent for class {}", clazz);
-            return false;
-        }
-
-        String clazzModelPackage = getModelRootPackageName(clazz.getPackage());
-        String parentModelPackage = getModelRootPackageName(parent.getPackage());
-
-        return !clazzModelPackage.equals(parentModelPackage);
-    }
-
     /**
      * Returns root package name for supplied package.
      *
index 605b8d1727fcdd8148f6273500aea366a892cab9..04a6ec23b75c2c4fd55b07c50c143dec1a5fd359 100644 (file)
@@ -39,7 +39,6 @@ public class BindingReflectionsTest {
         assertEquals("Module info should be empty Set", Collections.emptySet(),
                 BindingReflections.loadModuleInfos());
         assertFalse("Should not be RpcType", BindingReflections.isRpcType(DataObject.class));
-        assertFalse("Should not be AugmentationChild", BindingReflections.isAugmentationChild(DataObject.class));
         assertTrue("Should be BindingClass", BindingReflections.isBindingClass(DataObject.class));
         assertFalse("Should not be Notification", BindingReflections.isNotification(DataObject.class));