Reformulate StatementContextFactory.createEffective()
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / list / AbstractListEffectiveStatement.java
index ea83f751c15cf96e54a266403c6639584b3fef37..601640cae509811842eb9f9578cf75bd725f053e 100644 (file)
@@ -35,7 +35,7 @@ import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementMix
 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementMixins.UserOrderedMixin;
 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementMixins.WhenConditionMixin;
 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStmtUtils;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
 
 abstract class AbstractListEffectiveStatement
         extends DefaultWithDataTree<QName, ListStatement, ListEffectiveStatement>
@@ -51,14 +51,15 @@ abstract class AbstractListEffectiveStatement
     private final @NonNull SchemaPath path;
     private final @NonNull Object keyDefinition;
 
-    AbstractListEffectiveStatement(final ListStatement declared, final SchemaPath path, final int flags,
-            final StmtContext<?, ?, ?> ctx, final ImmutableList<? extends EffectiveStatement<?, ?>> substatements,
+    AbstractListEffectiveStatement(final Current<QName, ListStatement> stmt, final SchemaPath path,
+            final int flags, final ImmutableList<? extends EffectiveStatement<?, ?>> substatements,
             final ImmutableList<QName> keyDefinition) {
-        super(declared, ctx, substatements);
+        super(stmt.declared(), substatements, stmt.sourceReference());
 
-        EffectiveStmtUtils.checkUniqueGroupings(ctx, substatements);
-        EffectiveStmtUtils.checkUniqueTypedefs(ctx, substatements);
-        EffectiveStmtUtils.checkUniqueUses(ctx, substatements);
+        final var rabbit = stmt.caerbannog();
+        EffectiveStmtUtils.checkUniqueGroupings(rabbit, substatements, stmt.sourceReference());
+        EffectiveStmtUtils.checkUniqueTypedefs(rabbit, substatements, stmt.sourceReference());
+        EffectiveStmtUtils.checkUniqueUses(rabbit, substatements, stmt.sourceReference());
 
         this.substatements = maskList(substatements);
         this.path = requireNonNull(path);