Integrate {Inference,Source}Exception with CommonStmtCtx
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / import_ / RevisionImport.java
index f319b7b38c5b925eedc9e92f9d64fa29825282e7..edf52d00aab5f6ba7ea5ae9c839c11e96ba1ad62 100644 (file)
@@ -66,8 +66,7 @@ final class RevisionImport {
                 final StmtContext<?, ?, ?> importedModule = imported.resolve(ctx);
 
                 final QNameModule mod = InferenceException.throwIfNull(stmt.getFromNamespace(
-                    ModuleCtxToModuleQName.class, importedModule), stmt.sourceReference(),
-                    "Failed to find module of %s", importedModule);
+                    ModuleCtxToModuleQName.class, importedModule), stmt, "Failed to find module of %s", importedModule);
 
                 linkageTarget.resolve(ctx).addToNs(ImportedModuleContext.class,
                     stmt.getFromNamespace(ModuleCtxToSourceIdentifier.class, importedModule), importedModule);
@@ -82,8 +81,7 @@ final class RevisionImport {
             @Override
             public void prerequisiteFailed(final Collection<? extends Prerequisite<?>> failed) {
                 if (failed.contains(imported)) {
-                    throw new InferenceException(stmt.sourceReference(), "Imported module [%s] was not found.",
-                        moduleName);
+                    throw new InferenceException(stmt, "Imported module [%s] was not found.", moduleName);
                 }
             }
         });