Fix StmtContext nullness problems
[yangtools.git] / yang / yang-parser-reactor / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / reactor / SubstatementContext.java
index f45d65c0bddde499414f17ac121510d3e9fc96fb..10e59b4051478e05e9781a628828576b4de1669a 100644 (file)
@@ -140,7 +140,7 @@ final class SubstatementContext<A, D extends DeclaredStatement<A>, E extends Eff
             }
 
             final SchemaPath path;
-            if ((StmtContextUtils.producesDeclared(getParentContext(), ChoiceStatement.class)
+            if ((StmtContextUtils.producesDeclared(parent, ChoiceStatement.class)
                     || Boolean.TRUE.equals(parent.getFromNamespace(AugmentToChoiceNamespace.class, parent)))
                     && isSupportedAsShorthandCase()) {
                 path = parentPath.createChild(qname);
@@ -200,7 +200,7 @@ final class SubstatementContext<A, D extends DeclaredStatement<A>, E extends Eff
 
         final boolean isConfig;
         if (configStatement != null) {
-            isConfig = configStatement.getStatementArgument();
+            isConfig = configStatement.coerceStatementArgument();
 
             // Validity check: if parent is config=false this cannot be a config=true
             InferenceException.throwIf(isConfig && !parentIsConfig, getStatementSourceReference(),