Fixed resolution problems in Code Generator
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / impl / SchemaContextImpl.java
index 3eb87a9214e24bd84b7e51061f6e29e82aba4a87..2d1da1f8336f7eaff5caf95b6cb8076f8c4ea7aa 100644 (file)
@@ -84,11 +84,24 @@ final class SchemaContextImpl implements SchemaContext {
     }
 
     @Override
-    public Module findModuleByNamespace(final URI namespace) {
+    public Set<Module> findModuleByNamespace(final URI namespace) {
+        final Set<Module> ret = new HashSet<Module>();
         if (namespace != null) {
             for (final Module module : modules) {
                 if (module.getNamespace().equals(namespace)) {
-                    return module;
+                    ret.add(module);
+                }
+            }
+        }
+        return ret;
+    }
+
+    @Override
+    public Module findModuleByNamespaceAndRevision(URI namespace, Date revision) {
+        if (namespace != null) {
+            for (final Module module : modules) {
+                if (module.getNamespace().equals(namespace) && module.getRevision().equals(revision)) {
+                    return(module);
                 }
             }
         }