Create all effective statements path Nullable
[yangtools.git] / yang / rfc6643-parser-support / src / main / java / org / opendaylight / yangtools / rfc6643 / parser / SubIdEffectiveStatementImpl.java
index f3a46b74175edf7a8ba733a2eb842379e7f5781c..3e7577353988f86902f848a7242b7e868e117e04 100644 (file)
@@ -14,10 +14,12 @@ import org.opendaylight.yangtools.rfc6643.model.api.SubIdSchemaNode;
 import org.opendaylight.yangtools.rfc6643.model.api.SubIdStatement;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.model.api.SchemaNodeDefaults;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.UnknownEffectiveStatementBase;
 import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
+import org.opendaylight.yangtools.yang.parser.spi.meta.SchemaPathSupport;
 
 final class SubIdEffectiveStatementImpl extends UnknownEffectiveStatementBase<Uint32, SubIdStatement>
         implements SubIdEffectiveStatement, SubIdSchemaNode {
@@ -27,7 +29,7 @@ final class SubIdEffectiveStatementImpl extends UnknownEffectiveStatementBase<Ui
     SubIdEffectiveStatementImpl(final Current<Uint32, SubIdStatement> stmt,
             final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
         super(stmt, substatements);
-        path = stmt.getEffectiveParent().getSchemaPath().createChild(getNodeType());
+        path = SchemaPathSupport.wrap(stmt.getEffectiveParent().getSchemaPath().createChild(getNodeType()));
     }
 
     @Override
@@ -38,7 +40,7 @@ final class SubIdEffectiveStatementImpl extends UnknownEffectiveStatementBase<Ui
     @Override
     @Deprecated
     public SchemaPath getPath() {
-        return path;
+        return SchemaNodeDefaults.throwUnsupportedIfNull(this, path);
     }
 
     @Override