activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r947431 - /activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/Buffer.java
Date Sun, 23 May 2010 15:37:34 GMT
Author: chirino
Date: Sun May 23 15:37:33 2010
New Revision: 947431

URL: http://svn.apache.org/viewvc?rev=947431&view=rev
Log:
Buffer.toString returned a unexpected result when the buffer offset was not zero

Modified:
    activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/Buffer.java

Modified: activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/Buffer.java
URL: http://svn.apache.org/viewvc/activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/Buffer.java?rev=947431&r1=947430&r2=947431&view=diff
==============================================================================
--- activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/Buffer.java
(original)
+++ activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/Buffer.java
Sun May 23 15:37:33 2010
@@ -80,9 +80,12 @@ public class Buffer implements Comparabl
     }
 
     final public byte[] toByteArray() {
+        byte[] data = this.data;
+        int length = this.length;
         if (length != data.length) {
             byte t[] = new byte[length];
             System.arraycopy(data, offset, t, 0, length);
+            data = t;
         }
         return data;
     }



Mime
View raw message