- final Module module = schemaContext.findModuleByNamespaceAndRevision(URI.create(prefixedNS), null);
- checkArgument(module != null, "Could not find module for namespace %s", prefixedNS);
- return module.getQNameModule();
+ final Iterator<Module> modules = schemaContext.findModules(URI.create(prefixedNS)).iterator();
+ checkArgument(modules.hasNext(), "Could not find module for namespace %s", prefixedNS);
+ return modules.next().getQNameModule();