Bug 4656: Yang parser does not determine configuration true or false properly
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / AbstractEffectiveDataSchemaNode.java
index 42023f191a067f5707c1fd8a4cf9f31f4fdaf2ff..b8863bda726c896d8ef12ed9a75dac1f6558756b 100644 (file)
@@ -24,12 +24,10 @@ abstract class AbstractEffectiveDataSchemaNode<D extends DeclaredStatement<QName
     private final boolean configuration;
     private final ConstraintDefinition constraints;
 
-    public AbstractEffectiveDataSchemaNode(StmtContext<QName, D, ?> ctx) {
+    public AbstractEffectiveDataSchemaNode(final StmtContext<QName, D, ?> ctx) {
         super(ctx);
-        this.constraints = new EffectiveConstraintDefinitionImpl(this);
-
-        ConfigEffectiveStatementImpl configStmt = firstEffective(ConfigEffectiveStatementImpl.class);
-        this.configuration = (configStmt == null) ? true : configStmt.argument();
+        this.constraints = EffectiveConstraintDefinitionImpl.forParent(this);
+        this.configuration = ctx.isConfiguration();
 
         // initCopyType
         List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();