thrift-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bryanduxb...@apache.org
Subject svn commit: r894222 - /incubator/thrift/trunk/lib/java/src/org/apache/thrift/TUnion.java
Date Mon, 28 Dec 2009 18:49:04 GMT
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) {



Mime
View raw message