Share empty ConstraintDefinition instances
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / AbstractEffectiveDataSchemaNode.java
index 42023f191a067f5707c1fd8a4cf9f31f4fdaf2ff..c273cb5862d5018cadef53fe8fa40f6a6ae903b6 100644 (file)
@@ -24,9 +24,9 @@ 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);
+        this.constraints = EffectiveConstraintDefinitionImpl.forParent(this);
 
         ConfigEffectiveStatementImpl configStmt = firstEffective(ConfigEffectiveStatementImpl.class);
         this.configuration = (configStmt == null) ? true : configStmt.argument();