Bug 4614 - Reintroduce xid check for correct RPC handling 06/33906/2
authorMichal Polkorab <michal.polkorab@pantheon.sk>
Tue, 2 Feb 2016 14:20:27 +0000 (15:20 +0100)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Tue, 2 Feb 2016 15:41:05 +0000 (16:41 +0100)
Change-Id: I259147af4cbcab5115083df690edfa3cd3c8b5b9
Signed-off-by: Michal Polkorab <michal.polkorab@pantheon.sk>
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKey.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKeyTest.java

index 9cd482b1da5467b616468d09f97f22e30ba9f3cb..050f3cf76bdaea0261a94c48dadeade37db35c77 100644 (file)
@@ -68,6 +68,8 @@ public class RpcResponseKey {
             }
         } else if (!outputClazz.equals(other.outputClazz)) {
             return false;
+        } else if (xid != other.getXid()) {
+            return false;
         }
         return true;
     }
index 0b816c25714a492342f07071034f15250fdd978b..2ef9cb82618cb8f1dc51c15034fcf0da6a9b9e2d 100644 (file)
@@ -40,6 +40,8 @@ public class RpcResponseKeyTest {
         key1 = new RpcResponseKey(xid1, outputClazz1);
         Assert.assertFalse("Wrong equal by outputClazz.", key1.equals(key2));
         key2 = new RpcResponseKey(xid2, outputClazz1);
+        Assert.assertFalse("Wrong equal.", key1.equals(key2));
+        key1 = new RpcResponseKey(xid2, outputClazz1);
         Assert.assertTrue("Wrong equal.", key1.equals(key2));
     }