From 9f720af0c1cb38c2fbe48c7be03ace4d00ef2167 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 2 Mar 2022 01:00:19 +0100 Subject: [PATCH 1/1] Mark StmtContextUtils.isInExtensionBody() FIXME This methods dates back as far as April 2015, and probably does things we do not really want to do. Drop a FIXME for a follow-up. Change-Id: I3372171606ecb26b742de3fa772ece65df4b693b Signed-off-by: Robert Varga --- .../yangtools/yang/parser/spi/meta/StmtContextUtils.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/parser/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StmtContextUtils.java b/parser/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StmtContextUtils.java index b2eec96a17..b2b47ad8db 100644 --- a/parser/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StmtContextUtils.java +++ b/parser/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StmtContextUtils.java @@ -180,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; -- 2.36.6