From 1cc293de6dbed762df7dd21ee55efe732b1eb303 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Fri, 17 Sep 2010 02:51:22 +0000 Subject: QPID-2861 Added a simple null check to eliminate acting on a result that is no longer valid. I am also adding a log message at "WARN" level if we receive a result for a command that is no longer in our map. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@997965 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/transport/Session.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'java/common/src') diff --git a/java/common/src/main/java/org/apache/qpid/transport/Session.java b/java/common/src/main/java/org/apache/qpid/transport/Session.java index 52e0026f29..c891c95151 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/Session.java +++ b/java/common/src/main/java/org/apache/qpid/transport/Session.java @@ -767,7 +767,17 @@ public class Session extends SessionInvoker { future = results.remove(command); } - future.set(result); + + if (future != null) + { + future.set(result); + } + else + { + log.warn("Broker sent a result in response to a command" + + " that's no longer valid on the client side." + + " [ command id : %s , result : %s ]",command, result); + } } void setException(ExecutionException exc) -- cgit v1.2.1