浏览代码

HADOOP-1311. Fix a bug in BytesWritable#set() where the start offset was ignored. Contributed by Dhruba.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@546282 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 年之前
父节点
当前提交
a78e22350b
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 3 0
      CHANGES.txt
  2. 1 1
      src/java/org/apache/hadoop/io/BytesWritable.java

+ 3 - 0
CHANGES.txt

@@ -96,6 +96,9 @@ Trunk (unreleased changes)
  31. HADOOP-1336.  Re-enable speculative execution by
  31. HADOOP-1336.  Re-enable speculative execution by
      default. (omalley via cutting)
      default. (omalley via cutting)
 
 
+ 32. HADOOP-1311.  Fix a bug in BytesWritable#set() where start offset
+     was ignored.  (Dhruba Borthakur via cutting)
+
 
 
 Release 0.13.0 - 2007-06-08
 Release 0.13.0 - 2007-06-08
 
 

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

@@ -122,7 +122,7 @@ public class BytesWritable implements WritableComparable {
   public void set(byte[] newData, int offset, int length) {
   public void set(byte[] newData, int offset, int length) {
     setSize(0);
     setSize(0);
     setSize(length);
     setSize(length);
-    System.arraycopy(newData, 0, bytes, 0, size);
+    System.arraycopy(newData, offset, bytes, 0, size);
   }
   }
 
 
   // inherit javadoc
   // inherit javadoc