activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r1210506 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
Date Mon, 05 Dec 2011 15:49:36 GMT
Author: rajdavies
Date: Mon Dec  5 15:49:36 2011
New Revision: 1210506

URL: http://svn.apache.org/viewvc?rev=1210506&view=rev
Log:
commit patch for https://issues.apache.org/jira/browse/AMQ-3618

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java?rev=1210506&r1=1210505&r2=1210506&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
Mon Dec  5 15:49:36 2011
@@ -59,8 +59,8 @@ public final class OpenWireFormat implem
     private short nextMarshallCacheIndex;
     private short nextMarshallCacheEvictionIndex;
     private Map<DataStructure, Short> marshallCacheMap = new HashMap<DataStructure,
Short>();
-    private DataStructure marshallCache[] = new DataStructure[MARSHAL_CACHE_SIZE];
-    private DataStructure unmarshallCache[] = new DataStructure[MARSHAL_CACHE_SIZE];
+    private DataStructure marshallCache[] = null;
+    private DataStructure unmarshallCache[] = null;
     private DataByteArrayOutputStream bytesOut = new DataByteArrayOutputStream();
     private DataByteArrayInputStream bytesIn = new DataByteArrayInputStream();
     private WireFormatInfo preferedWireFormatInfo;
@@ -572,6 +572,10 @@ public final class OpenWireFormat implem
     }
 
     public void setCacheEnabled(boolean cacheEnabled) {
+        if(cacheEnabled){
+            marshallCache = new DataStructure[MARSHAL_CACHE_SIZE];
+            unmarshallCache = new DataStructure[MARSHAL_CACHE_SIZE];
+        }
         this.cacheEnabled = cacheEnabled;
     }
 



Mime
View raw message