From 867607566914d5b8a79e161eb0a40c4be9e01746 Mon Sep 17 00:00:00 2001 From: Michal Polkorab Date: Tue, 2 Feb 2016 15:20:27 +0100 Subject: [PATCH] Bug 4614 - Reintroduce xid check for correct RPC handling Change-Id: I259147af4cbcab5115083df690edfa3cd3c8b5b9 Signed-off-by: Michal Polkorab --- .../protocol/impl/core/connection/RpcResponseKey.java | 2 ++ .../protocol/impl/core/connection/RpcResponseKeyTest.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKey.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKey.java index 9cd482b1..050f3cf7 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKey.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKey.java @@ -68,6 +68,8 @@ public class RpcResponseKey { } } else if (!outputClazz.equals(other.outputClazz)) { return false; + } else if (xid != other.getXid()) { + return false; } return true; } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKeyTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKeyTest.java index 0b816c25..2ef9cb82 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKeyTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKeyTest.java @@ -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)); } -- 2.36.6