Fix IdentityrefTypeDefinition comparison 55/64955/7
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 31 Oct 2017 16:01:11 +0000 (17:01 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 3 Nov 2017 15:46:02 +0000 (16:46 +0100)
IdentityrefTypeDefinition can contain multiple base identities, hence
the comparison needs to take into account all of them.

Change-Id: Ibe90cf1dc7fed8a2c1f3f7f16606f85d6761bb50
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/TypeDefinitions.java

index 608d695f34e8650d9b9b224cfc17b3f094981ea0..b9dd40a2e27046c127ee610ef6e7c885c5cb25f3 100644 (file)
@@ -178,7 +178,7 @@ final class TypeDefinitions {
         }
 
         final IdentityrefTypeDefinition other = castIfEquals(IdentityrefTypeDefinition.class, type, obj);
-        return other != null && type.getIdentity().equals(other.getIdentity());
+        return other != null && type.getIdentities().equals(other.getIdentities());
     }
 
     static boolean equals(final InstanceIdentifierTypeDefinition type, final Object obj) {