Mark StmtContextUtils.isInExtensionBody() FIXME
[yangtools.git] / parser / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / StmtContextUtils.java
index 74620a64822c55c9b7521f4167f3dbac2967027e..b2b47ad8db369bee2e300232724ae50769a1d66c 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()) {
@@ -201,6 +180,15 @@ public final class StmtContextUtils {
         return null;
     }
 
+    // FIXME: 8.0.0: This method goes back as far as YANGTOOLS-365, when we were build EffectiveStatements for
+    //               unsupported YANG extensions. We are not doing that anymore, do we still need this method? Also, it
+    //               is only used in augment support to disable mechanics on unknown nodes.
+    //
+    //               It would seem we can move this method to AbstractAugmentStatementSupport at the very least, but
+    //               also: augments are defined to operate on schema tree nodes, hence even if we have an
+    //               UnknownStatement, but its EffectiveStatement projection supports SchemaTreeAwareEffectiveStatement
+    //               we should operate normally -- the StatementSupport exposing such semantics is responsible for
+    //               arranging the backend details.
     public static boolean isInExtensionBody(final StmtContext<?, ?, ?> stmtCtx) {
         StmtContext<?, ?, ?> current = stmtCtx;