Fix wrong comparison 27/64727/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 25 Oct 2017 16:36:25 +0000 (18:36 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 25 Oct 2017 16:36:25 +0000 (18:36 +0200)
This is pointed out by eclipse: QName will never compare as equal
with a QNameModule. Fix the thinko.

Change-Id: I32b0856fb533189be4700a4f7e3eeb00eb319b44
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/KeyStatementImpl.java

index 6f15bc311ce8201675af7f47f6df0b147ef04700..1aa600b1159f6c49441886172cc69148ae3a0b52 100644 (file)
@@ -69,7 +69,7 @@ public class KeyStatementImpl extends AbstractDeclaredStatement<Collection<Schem
             boolean replaced = false;
             for (final SchemaNodeIdentifier arg : ctx.getStatementArgument()) {
                 final QName qname = arg.getLastComponent();
-                if (!targetModule.equals(qname)) {
+                if (!targetModule.equals(qname.getModule())) {
                     final QName newQname = ctx.getFromNamespace(QNameCacheNamespace.class,
                             QName.create(targetModule, qname.getLocalName()));
                     builder.add(SchemaNodeIdentifier.create(false, newQname));