1
0
Pārlūkot izejas kodu

HADOOP-1584. Fix a bug in GenericWritable that limited it to 128 types. Contributed by Espen Amble Kolstad.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@555377 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 gadi atpakaļ
vecāks
revīzija
84ed4a67f1
2 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 3 0
      CHANGES.txt
  2. 1 1
      src/java/org/apache/hadoop/io/GenericWritable.java

+ 3 - 0
CHANGES.txt

@@ -303,6 +303,9 @@ Trunk (unreleased changes)
  93. HADOOP-1578.  Fix datanode to send its storage id to namenode
  93. HADOOP-1578.  Fix datanode to send its storage id to namenode
      during registration.  (Konstantin Shvachko via cutting)
      during registration.  (Konstantin Shvachko via cutting)
 
 
+ 94. HADOOP-1584.  Fix a bug in GenericWritable which limited it to
+     128 types instead of 256.  (Espen Amble Kolstad via cutting)
+
 
 
 Release 0.13.0 - 2007-06-08
 Release 0.13.0 - 2007-06-08
 
 

+ 1 - 1
src/java/org/apache/hadoop/io/GenericWritable.java

@@ -81,7 +81,7 @@ public abstract class GenericWritable implements Writable {
 
 
   public void readFields(DataInput in) throws IOException {
   public void readFields(DataInput in) throws IOException {
     type = in.readByte();
     type = in.readByte();
-    Class clazz = getTypes()[type];
+    Class clazz = getTypes()[type & 0xff];
     try {
     try {
       instance = (Writable) clazz.newInstance();
       instance = (Writable) clazz.newInstance();
     } catch (Exception e) {
     } catch (Exception e) {