Move more statements
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / choice / ChoiceStatementSupport.java
index 049d41257485ce7db83a9f388f0aa3fd26afcad2..48449760d1138211e72f1c7b9b921a05f1a34462 100644 (file)
@@ -27,10 +27,11 @@ import org.opendaylight.yangtools.yang.model.api.stmt.ChoiceStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.DefaultEffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.MandatoryEffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.StatusEffectiveStatement;
+import org.opendaylight.yangtools.yang.model.ri.stmt.DeclaredStatements;
+import org.opendaylight.yangtools.yang.model.ri.stmt.EffectiveStatements;
+import org.opendaylight.yangtools.yang.model.spi.meta.EffectiveStatementMixins.EffectiveStatementWithFlags.FlagsBuilder;
 import org.opendaylight.yangtools.yang.model.spi.meta.SubstatementIndexingException;
-import org.opendaylight.yangtools.yang.model.spi.stmt.DeclaredStatements;
 import org.opendaylight.yangtools.yang.parser.rfc7950.reactor.YangValidationBundles;
-import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementMixins.EffectiveStatementWithFlags.FlagsBuilder;
 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.case_.CaseStatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractSchemaTreeStatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
@@ -126,9 +127,8 @@ public final class ChoiceStatementSupport
     @Override
     public ChoiceEffectiveStatement copyEffective(final Current<QName, ChoiceStatement> stmt,
             final ChoiceEffectiveStatement original) {
-        return new ChoiceEffectiveStatementImpl((ChoiceEffectiveStatementImpl) original,
-            computeFlags(stmt, original.effectiveSubstatements()), stmt.effectivePath(),
-            (ChoiceSchemaNode) stmt.original());
+        return EffectiveStatements.copyChoice(original, stmt.effectivePath(),
+            computeFlags(stmt, original.effectiveSubstatements()), stmt.original(ChoiceSchemaNode.class));
     }
 
     @Override
@@ -152,8 +152,8 @@ public final class ChoiceStatementSupport
         }
 
         try {
-            return new ChoiceEffectiveStatementImpl(stmt.declared(), substatements, computeFlags(stmt, substatements),
-                stmt.effectivePath(), defaultCase, (ChoiceSchemaNode) stmt.original());
+            return EffectiveStatements.createChoice(stmt.declared(), stmt.effectivePath(),
+                computeFlags(stmt, substatements), substatements, defaultCase, stmt.original(ChoiceSchemaNode.class));
         } catch (SubstatementIndexingException e) {
             throw new SourceException(e.getMessage(), stmt, e);
         }