Remove StmtContextUtils.findFirstSubstatement() 10/99010/5
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 15 Dec 2021 11:15:53 +0000 (12:15 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 15 Dec 2021 14:13:47 +0000 (15:13 +0100)
This utility method has an integrated replacement, remove it.

Change-Id: I117bd331c6381e27830796c3a6f86ad9f1acbd4c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
parser/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StmtContextUtils.java

index 74620a64822c55c9b7521f4167f3dbac2967027e..b2eec96a17efb97dbd4aa4347c77bfd9b3544deb 100644 (file)
@@ -146,27 +146,6 @@ public final class StmtContextUtils {
         return null;
     }
 
-    /**
-     * Searches for the first substatement of the specified type in the specified statement context.
-     * First, it tries to find the substatement in the effective substatements of the statement context.
-     * If it was not found, then it proceeds to search in the declared substatements. If it still was not found,
-     * the method returns null.
-     *
-     * @param stmtContext statement context to search in
-     * @param declaredType substatement type to search for
-     * @param <A> statement argument type
-     * @param <D> declared statement type
-     * @return statement context that was searched for or null if was not found
-     * @deprecated Use {@link BoundStmtCtx#findSubstatementArgument(Class)} instead.
-     */
-    @Deprecated(forRemoval = true)
-    public static <A, D extends DeclaredStatement<A>> StmtContext<A, ?, ?> findFirstSubstatement(
-            final StmtContext<?, ?, ?> stmtContext, final Class<D> declaredType) {
-        final StmtContext<A, ?, ?> effectiveSubstatement = findFirstEffectiveSubstatement(stmtContext, declaredType);
-        return effectiveSubstatement != null ? effectiveSubstatement : findFirstDeclaredSubstatement(stmtContext,
-                declaredType);
-    }
-
     public static <D extends DeclaredStatement<?>> StmtContext<?, ?, ?> findFirstDeclaredSubstatementOnSublevel(
             final StmtContext<?, ?, ?> stmtContext, final Class<? super D> declaredType, int sublevel) {
         for (final StmtContext<?, ?, ?> subStmtContext : stmtContext.declaredSubstatements()) {