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 / LeafListEffectiveStatementImpl.java
index 8840670ea3fb99240708b3a0a06007b7226d9ad3..218e845f6bccdd3c0c730e55688bbc304267a57a 100644 (file)
@@ -7,9 +7,6 @@
  */
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
 
-import java.util.Set;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
-
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.TypeUtils;
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
@@ -34,7 +31,7 @@ public class LeafListEffectiveStatementImpl extends AbstractEffectiveDocumentedN
     private final QName qname;
     private final SchemaPath path;
 
-    private boolean augmenting;
+    boolean augmenting;
     private boolean addedByUses;
     private LeafListSchemaNode original;
     private boolean configuration = true;
@@ -60,7 +57,7 @@ public class LeafListEffectiveStatementImpl extends AbstractEffectiveDocumentedN
     private void initCopyType(
             StmtContext<QName, LeafListStatement, EffectiveStatement<QName, LeafListStatement>> ctx) {
 
-        Set<TypeOfCopy> copyTypesFromOriginal = StmtContextUtils.getCopyTypesFromOriginal(ctx);
+        List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
 
         if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
             augmenting = true;
@@ -72,7 +69,7 @@ public class LeafListEffectiveStatementImpl extends AbstractEffectiveDocumentedN
             addedByUses = augmenting = true;
         }
 
-        if (ctx.getTypeOfCopy() != TypeOfCopy.ORIGINAL) {
+        if (ctx.getOriginalCtx() != null) {
             original = (LeafListSchemaNode) ctx.getOriginalCtx().buildEffective();
         }
     }