- private static boolean isInstantied(final StmtContext<?, ?, ?> ctx) {
- for (StmtContext<?, ?, ?> parent = ctx.getParentContext(); parent != null; parent = parent.getParentContext()) {
- if (UNINSTANTIATED_DATATREE_STATEMENTS.contains(parent.getPublicDefinition())) {
+ private static void warnConfigList(final @NonNull Current<QName, ListStatement> stmt) {
+ final StatementSourceReference ref = stmt.sourceReference();
+ final Boolean warned = stmt.getFromNamespace(ConfigListWarningNamespace.class, ref);
+ // Hacky check if we have issued a warning for the original statement
+ if (warned == null) {
+ final StmtContext<?, ?, ?> ctx = stmt.caerbannog();
+ verify(ctx instanceof Mutable, "Unexpected context %s", ctx);
+ ((Mutable<?, ?, ?>) ctx).addToNs(ConfigListWarningNamespace.class, ref, Boolean.TRUE);
+ LOG.info("Configuration list {} does not define any keys in violation of RFC7950 section 7.8.2. While "
+ + "this is fine with OpenDaylight, it can cause interoperability issues with other systems "
+ + "[defined at {}]", stmt.argument(), ref);
+ }
+ }
+
+ private static boolean isInstantied(final EffectiveStmtCtx ctx) {
+ Parent parent = ctx.effectiveParent();
+ while (parent != null) {
+ final StatementDefinition parentDef = parent.publicDefinition();
+ if (UNINSTANTIATED_DATATREE_STATEMENTS.contains(parentDef)) {