activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1515854 - /activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageAuditNoSync.java
Date Tue, 20 Aug 2013 16:05:36 GMT
Author: chirino
Date: Tue Aug 20 16:05:35 2013
New Revision: 1515854

URL: http://svn.apache.org/r1515854
Log:
Make sure the LRUCache key is always a String.

Modified:
    activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageAuditNoSync.java

Modified: activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageAuditNoSync.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageAuditNoSync.java?rev=1515854&r1=1515853&r2=1515854&view=diff
==============================================================================
--- activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageAuditNoSync.java
(original)
+++ activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageAuditNoSync.java
Tue Aug 20 16:05:35 2013
@@ -41,7 +41,7 @@ public class ActiveMQMessageAuditNoSync 
     public static final int MAXIMUM_PRODUCER_COUNT = 64;
     private int auditDepth;
     private int maximumNumberOfProducersToTrack;
-    private final LRUCache<Object, BitArrayBin> map;
+    private final LRUCache<String, BitArrayBin> map;
     private transient boolean modified = true;
 
     /**
@@ -60,7 +60,7 @@ public class ActiveMQMessageAuditNoSync 
     public ActiveMQMessageAuditNoSync(int auditDepth, final int maximumNumberOfProducersToTrack)
{
         this.auditDepth = auditDepth;
         this.maximumNumberOfProducersToTrack=maximumNumberOfProducersToTrack;
-        this.map = new LRUCache<Object, BitArrayBin>(0, maximumNumberOfProducersToTrack,
0.75f, true);
+        this.map = new LRUCache<String, BitArrayBin>(0, maximumNumberOfProducersToTrack,
0.75f, true);
     }
 
     /**
@@ -91,7 +91,7 @@ public class ActiveMQMessageAuditNoSync 
     public void setMaximumNumberOfProducersToTrack(int maximumNumberOfProducersToTrack) {
 
         if (maximumNumberOfProducersToTrack < this.maximumNumberOfProducersToTrack){
-            LRUCache<Object, BitArrayBin> newMap = new LRUCache<Object, BitArrayBin>(0,maximumNumberOfProducersToTrack,0.75f,true);
+            LRUCache<String, BitArrayBin> newMap = new LRUCache<String, BitArrayBin>(0,maximumNumberOfProducersToTrack,0.75f,true);
             /**
              * As putAll will access the entries in the right order,
              * this shouldn't result in wrong cache entries being removed
@@ -165,7 +165,7 @@ public class ActiveMQMessageAuditNoSync 
         if (id != null) {
             ProducerId pid = id.getProducerId();
             if (pid != null) {
-                BitArrayBin bab = map.get(pid);
+                BitArrayBin bab = map.get(pid.toString());
                 if (bab == null) {
                     bab = new BitArrayBin(auditDepth);
                     map.put(pid.toString(), bab);
@@ -196,7 +196,7 @@ public class ActiveMQMessageAuditNoSync 
         if (id != null) {
             ProducerId pid = id.getProducerId();
             if (pid != null) {
-                BitArrayBin bab = map.get(pid);
+                BitArrayBin bab = map.get(pid.toString());
                 if (bab != null) {
                     bab.setBit(id.getProducerSequenceId(), false);
                     modified = true;
@@ -269,7 +269,7 @@ public class ActiveMQMessageAuditNoSync 
         if (id != null) {
             ProducerId pid = id.getProducerId();
             if (pid != null) {
-                BitArrayBin bab = map.get(pid);
+                BitArrayBin bab = map.get(pid.toString());
                 if (bab == null) {
                     bab = new BitArrayBin(auditDepth);
                     map.put(pid.toString(), bab);



Mime
View raw message