Adjust to yangtools-2.0.0 changes
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / UnionTypeCodec.java
index fd971233f58b822626a716a0645abeb49377e82a..ff4873734f175b44370a84fb66c90c265c0d6b65 100644 (file)
@@ -73,8 +73,7 @@ final class UnionTypeCodec extends ReflectionBasedCodec {
             final BindingCodecContext bindingCodecContext, final Set<UnionValueOptionContext> values,
             final TypeDefinition<?> subtype) throws NoSuchMethodException {
         final SchemaContext schemaContext = bindingCodecContext.getRuntimeContext().getSchemaContext();
-        final Module module = schemaContext.findModuleByNamespaceAndRevision(subtype.getQName().getNamespace(),
-                subtype.getQName().getRevision());
+        final Module module = schemaContext.findModule(subtype.getQName().getModule()).get();
         final RevisionAwareXPath xpath = ((LeafrefTypeDefinition) subtype).getPathStatement();
         // find schema node in schema context by xpath of leafref
         final SchemaNode dataNode;