Add the parent module of a submodule to the set of required lib sources
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / reactor / BuildGlobalContext.java
index 1220ff775787e02a27bbad73f359a55b7b4be22f..3e77b2cd4603935e460b46227fac5d65f1c9e4a6 100644 (file)
@@ -445,8 +445,9 @@ class BuildGlobalContext extends NamespaceStorageSupport implements NamespaceBeh
 
     private static SourceSpecificContext getRequiredLibSource(final ModuleIdentifier requiredModule,
             final TreeBasedTable<String, Date, SourceSpecificContext> libSourcesTable) {
-        return requiredModule.getRevision() == SimpleDateFormatUtil.DEFAULT_DATE_IMP ? getLatestRevision(libSourcesTable
-                .row(requiredModule.getName())) : libSourcesTable.get(requiredModule.getName(),
+        return requiredModule.getRevision() == SimpleDateFormatUtil.DEFAULT_DATE_IMP
+                || requiredModule.getRevision() == SimpleDateFormatUtil.DEFAULT_BELONGS_TO_DATE ? getLatestRevision(
+                libSourcesTable.row(requiredModule.getName())) : libSourcesTable.get(requiredModule.getName(),
                 requiredModule.getRevision());
     }