Integrate {Inference,Source}Exception with CommonStmtCtx
[yangtools.git] / yang / yang-parser-reactor / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / reactor / InferredStatementContext.java
index b3f7278a884c32f1c12dded48f8ab356a05bac72..c355148b604c94c05ba2246169c6c4294fd9f87f 100644 (file)
@@ -247,8 +247,8 @@ final class InferredStatementContext<A, D extends DeclaredStatement<A>, E extend
 
         @SuppressWarnings("unchecked")
         final Mutable<QName, Y, Z> ret = (Mutable<QName, Y, Z>) copySubstatement((Mutable<?, ?, ?>) template)
-            .orElseThrow(() -> new InferenceException(sourceReference(),
-                "Failed to materialize child %s template %s", qname, template));
+            .orElseThrow(
+                () -> new InferenceException(this, "Failed to materialize child %s template %s", qname, template));
         ensureCompletedPhase(ret);
         addMaterialized(template, ret);