Bug 3670 (part 1/5): Use of new statement parser in yang-maven-plugin
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / ListEffectiveStatementImpl.java
index 84451a4c5748e77f82f8d903691a214239883098..1f9644cf0b5c134195633cd4bd8629574793c9cf 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
 
 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
 
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
@@ -39,7 +38,7 @@ public class ListEffectiveStatementImpl extends AbstractEffectiveDocumentedDataN
     private final SchemaPath path;
 
     boolean augmenting;
-    boolean addedByUses;
+    private boolean addedByUses;
     ListSchemaNode original;
     boolean configuration = true;
     ConstraintDefinition constraints;
@@ -65,7 +64,7 @@ public class ListEffectiveStatementImpl extends AbstractEffectiveDocumentedDataN
     private void initCopyType(
             StmtContext<QName, ListStatement, EffectiveStatement<QName, ListStatement>> ctx) {
 
-        Set<TypeOfCopy> copyTypesFromOriginal = StmtContextUtils.getCopyTypesFromOriginal(ctx);
+        List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
 
         if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
             augmenting = true;
@@ -77,7 +76,7 @@ public class ListEffectiveStatementImpl extends AbstractEffectiveDocumentedDataN
             addedByUses = augmenting = true;
         }
 
-        if (ctx.getTypeOfCopy() != TypeOfCopy.ORIGINAL) {
+        if (ctx.getOriginalCtx() != null) {
             original = (ListSchemaNode) ctx.getOriginalCtx().buildEffective();
         }
     }