Convert trivial CopyPolicy users to StatementPolicy
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / config / ConfigStatementSupport.java
index 143196f029c56f0224596da103cd213fead5973a..1a4e817379bccaebb44db3ea5e571124d7e23a91 100644 (file)
@@ -24,8 +24,12 @@ public final class ConfigStatementSupport
     private static final ConfigStatementSupport INSTANCE = new ConfigStatementSupport();
 
     private ConfigStatementSupport() {
-        super(YangStmtMapping.CONFIG, new EmptyConfigEffectiveStatement(new EmptyConfigStatement(Boolean.FALSE)),
-            new EmptyConfigEffectiveStatement(new EmptyConfigStatement(Boolean.TRUE)));
+        super(YangStmtMapping.CONFIG,
+            new EmptyConfigEffectiveStatement(new EmptyConfigStatement(Boolean.FALSE)),
+            new EmptyConfigEffectiveStatement(new EmptyConfigStatement(Boolean.TRUE)),
+            // FIXME: This is not quite true. If we are instantiated in a context which ignores config, which should
+            //        really fizzle. This needs some more analysis.
+            StatementPolicy.contextIndependent());
     }
 
     public static ConfigStatementSupport getInstance() {
@@ -40,13 +44,12 @@ public final class ConfigStatementSupport
     @Override
     protected ConfigStatement createDeclared(final StmtContext<Boolean, ConfigStatement, ?> ctx,
             final ImmutableList<? extends DeclaredStatement<?>> substatements) {
-        return new RegularConfigStatement(ctx.coerceStatementArgument(), substatements);
+        return new RegularConfigStatement(ctx.getArgument(), substatements);
     }
 
     @Override
-    protected ConfigEffectiveStatement createEffective(
-            final StmtContext<Boolean, ConfigStatement, ConfigEffectiveStatement> ctx,
-            final ConfigStatement declared, final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
+    protected ConfigEffectiveStatement createEffective(final ConfigStatement declared,
+            final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
         return new RegularConfigEffectiveStatement(declared, substatements);
     }