1
0
Quellcode durchsuchen

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 vor 18 Jahren
Ursprung
Commit
84ed4a67f1
2 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  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
      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
 

+ 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 {
     type = in.readByte();
-    Class clazz = getTypes()[type];
+    Class clazz = getTypes()[type & 0xff];
     try {
       instance = (Writable) clazz.newInstance();
     } catch (Exception e) {