activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r789336 - /activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/TransactionManager.java
Date Mon, 29 Jun 2009 14:13:27 GMT
Author: chirino
Date: Mon Jun 29 14:13:27 2009
New Revision: 789336

URL: http://svn.apache.org/viewvc?rev=789336&view=rev
Log:
use '& 0xFF' to work with the unsigned byte values.


Modified:
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/TransactionManager.java

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/TransactionManager.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/TransactionManager.java?rev=789336&r1=789335&r2=789336&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/TransactionManager.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/TransactionManager.java
Mon Jun 29 14:13:27 2009
@@ -228,7 +228,7 @@
             tx = new LocalTransaction(this, tid, queue);
             break;
         case Transaction.TYPE_XA:
-        	int length = bais.readByte();
+        	int length = bais.readByte() & 0xFF;
         	Buffer xid = new Buffer(new byte[length]);
         	bais.readFully(xid.data);
             tx = new XATransaction(this, tid, xid, queue);
@@ -252,8 +252,8 @@
         if(tx.getType() == Transaction.TYPE_XA)
         {
         	Buffer xid = ((XATransaction)tx).getXid();
-        	// An XID max size is around 140 bytes
-        	baos.writeByte( xid.length );
+        	// An XID max size is around 140 bytes, byte SHOULD be big enough to frame it.
+        	baos.writeByte( xid.length & 0xFF );
         	baos.write(xid.data, xid.offset, xid.length);
         }
         



Mime
View raw message