diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 7ca333868a0..e5acdca228d 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -211,6 +211,9 @@ Release 2.2.1 - UNRELEASED HADOOP-10110. hadoop-auth has a build break due to missing dependency. (Chuan Liu via arp) + HADOOP-9114. After defined the dfs.checksum.type as the NULL, write file and hflush will + through java.lang.ArrayIndexOutOfBoundsException (Sathish via umamahesh) + Release 2.2.0 - 2013-10-13 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSOutputSummer.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSOutputSummer.java index 691fbfbd16d..49c919af196 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSOutputSummer.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSOutputSummer.java @@ -183,10 +183,13 @@ static public byte[] convertToByteStream(Checksum sum, int checksumSize) { } static byte[] int2byte(int integer, byte[] bytes) { - bytes[0] = (byte)((integer >>> 24) & 0xFF); - bytes[1] = (byte)((integer >>> 16) & 0xFF); - bytes[2] = (byte)((integer >>> 8) & 0xFF); - bytes[3] = (byte)((integer >>> 0) & 0xFF); + if (bytes.length != 0) { + bytes[0] = (byte) ((integer >>> 24) & 0xFF); + bytes[1] = (byte) ((integer >>> 16) & 0xFF); + bytes[2] = (byte) ((integer >>> 8) & 0xFF); + bytes[3] = (byte) ((integer >>> 0) & 0xFF); + return bytes; + } return bytes; }