X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-data-codec-xml%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fdata%2Fcodec%2Fxml%2FIdentityrefXmlCodec.java;fp=yang%2Fyang-data-codec-xml%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fdata%2Fcodec%2Fxml%2FIdentityrefXmlCodec.java;h=dd36e738deaa06de79af438edd774ab2c853b7a6;hb=ae76efb1486909a2a57102a23b4d0fc7efee95a0;hp=4a0726d63247f7c5c436b33b6e04ce8b9fd0877a;hpb=995d312c14bd31d62d0faa8b11773bc4399cfc4f;p=yangtools.git diff --git a/yang/yang-data-codec-xml/src/main/java/org/opendaylight/yangtools/yang/data/codec/xml/IdentityrefXmlCodec.java b/yang/yang-data-codec-xml/src/main/java/org/opendaylight/yangtools/yang/data/codec/xml/IdentityrefXmlCodec.java index 4a0726d632..dd36e738de 100644 --- a/yang/yang-data-codec-xml/src/main/java/org/opendaylight/yangtools/yang/data/codec/xml/IdentityrefXmlCodec.java +++ b/yang/yang-data-codec-xml/src/main/java/org/opendaylight/yangtools/yang/data/codec/xml/IdentityrefXmlCodec.java @@ -12,6 +12,7 @@ import static com.google.common.base.Preconditions.checkArgument; import static java.util.Objects.requireNonNull; import java.net.URI; +import java.util.Iterator; import java.util.Map.Entry; import javax.xml.namespace.NamespaceContext; import javax.xml.stream.XMLStreamException; @@ -44,9 +45,9 @@ final class IdentityrefXmlCodec implements XmlCodec { } final String prefixedNS = ctx.getNamespaceURI(prefix); - 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 modules = schemaContext.findModules(URI.create(prefixedNS)).iterator(); + checkArgument(modules.hasNext(), "Could not find module for namespace %s", prefixedNS); + return modules.next().getQNameModule(); }); }