Browse Source

HADOOP-1088. Fix record serialization of negative values. Contributed by Milind.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@515858 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 years ago
parent
commit
f2e710ec32
2 changed files with 5 additions and 2 deletions
  1. 3 0
      CHANGES.txt
  2. 2 2
      src/java/org/apache/hadoop/record/Utils.java

+ 3 - 0
CHANGES.txt

@@ -27,6 +27,9 @@ Trunk (unreleased changes)
  7. HADOOP-1082.  Fix a NullPointerException in ChecksumFileSystem.
     (Hairong Kuang via cutting)
 
+ 8. HADOOP-1088.  Fix record serialization of negative values.
+    (Milind Bhandarkar via cutting)
+
 
 Release 0.12.0 - 2007-03-02
 

+ 2 - 2
src/java/org/apache/hadoop/record/Utils.java

@@ -196,7 +196,7 @@ public class Utils {
     for (int idx = 0; idx < blen; idx++) {
       char c1 = s.charAt(2*idx);
       char c2 = s.charAt(2*idx+1);
-      barr[idx] = Byte.parseByte(""+c1+c2, 16);
+      barr[idx] = (byte)Integer.parseInt(""+c1+c2, 16);
     }
     return new Buffer(barr);
   }
@@ -230,7 +230,7 @@ public class Utils {
     for (int idx = 0; idx < blen; idx++) {
       char c1 = s.charAt(2*idx+1);
       char c2 = s.charAt(2*idx+2);
-      barr[idx] = Byte.parseByte(""+c1+c2, 16);
+      barr[idx] = (byte)Integer.parseInt(""+c1+c2, 16);
     }
     return new Buffer(barr);
   }