You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2018/05/03 08:50:18 UTC
qpid-jms-amqp-0-x git commit: QPID-8141: [JMS AMQP 0-x] Bug fix -
restore cache like behaviour
Repository: qpid-jms-amqp-0-x
Updated Branches:
refs/heads/master 6a5ffcf48 -> f5fb52de7
QPID-8141: [JMS AMQP 0-x] Bug fix - restore cache like behaviour
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/commit/f5fb52de
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/tree/f5fb52de
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/diff/f5fb52de
Branch: refs/heads/master
Commit: f5fb52de71b765ee02d3f57f1b6e81ba651f7b19
Parents: 6a5ffcf
Author: Keith Wall <kw...@apache.org>
Authored: Thu May 3 09:49:53 2018 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Thu May 3 09:49:53 2018 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/qpid/client/AMQSession.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/blob/f5fb52de/client/src/main/java/org/apache/qpid/client/AMQSession.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/qpid/client/AMQSession.java b/client/src/main/java/org/apache/qpid/client/AMQSession.java
index b5d4870..5d97a8b 100644
--- a/client/src/main/java/org/apache/qpid/client/AMQSession.java
+++ b/client/src/main/java/org/apache/qpid/client/AMQSession.java
@@ -21,6 +21,7 @@
package org.apache.qpid.client;
import java.io.Serializable;
+import java.lang.ref.WeakReference;
import java.net.URISyntaxException;
import java.text.MessageFormat;
import java.util.ArrayList;
@@ -150,8 +151,8 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic
*/
protected final boolean DAEMON_DISPATCHER_THREAD = Boolean.getBoolean(ClientProperties.DAEMON_DISPATCHER);
- private final Map<AMQDestination, AMQDestination>
- _resolvedDestinations = Collections.synchronizedMap(new WeakHashMap<AMQDestination, AMQDestination>());
+ private final Map<AMQDestination, WeakReference<AMQDestination>>
+ _resolvedDestinations = Collections.synchronizedMap(new WeakHashMap<AMQDestination, WeakReference<AMQDestination>> ());
private final long _dispatcherShutdownTimeoutMs;
@@ -661,7 +662,7 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic
void setResolved(final AMQDestination dest)
{
- _resolvedDestinations.put(dest, dest);
+ _resolvedDestinations.put(dest, new WeakReference<>(dest));
}
void setUnresolved(final AMQDestination dest)
@@ -676,7 +677,8 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic
boolean isResolved(final AMQDestination dest)
{
- AMQDestination resolvedDest = _resolvedDestinations.get(dest);
+ final WeakReference<AMQDestination> resolvedDestRef = _resolvedDestinations.get(dest);
+ final AMQDestination resolvedDest = resolvedDestRef == null ? null : resolvedDestRef.get();
if (resolvedDest == dest)
{
return true;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org