You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by br...@apache.org on 2009/12/28 19:49:04 UTC

svn commit: r894222 - /incubator/thrift/trunk/lib/java/src/org/apache/thrift/TUnion.java

Author: bryanduxbury
Date: Mon Dec 28 18:49:03 2009
New Revision: 894222

URL: http://svn.apache.org/viewvc?rev=894222&view=rev
Log:
(no ticket). java: Make Unions print binary values more tersely

Bytes were getting sign-extended out into giant strings of f's. This change makes sure only the bottom byte is used.

Modified:
    incubator/thrift/trunk/lib/java/src/org/apache/thrift/TUnion.java

Modified: incubator/thrift/trunk/lib/java/src/org/apache/thrift/TUnion.java
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/java/src/org/apache/thrift/TUnion.java?rev=894222&r1=894221&r2=894222&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/java/src/org/apache/thrift/TUnion.java (original)
+++ incubator/thrift/trunk/lib/java/src/org/apache/thrift/TUnion.java Mon Dec 28 18:49:03 2009
@@ -212,7 +212,7 @@
       if (i != 0) {
         sb.append(" ");
       }
-      String digit = Integer.toHexString(bytes[i]);
+      String digit = Integer.toHexString(bytes[i] & 0xFF);
       sb.append(digit.length() > 1 ? digit : "0" + digit);
     }
     if (bytes.length > 128) {