Explorar o código

HADOOP-5379. CBZip2InputStream to throw IOException on data crc error. (Rodrigo Schmidt via zshao)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.19@752777 13f79535-47bb-0310-9956-ffa450edef68
Zheng Shao %!s(int64=16) %!d(string=hai) anos
pai
achega
ede0654af7

+ 3 - 0
CHANGES.txt

@@ -4,6 +4,9 @@ Release 0.19.2 - Unreleased
 
   BUG FIXES
 
+    HADOOP-5379. CBZip2InputStream to throw IOException on data crc error.
+    (Rodrigo Schmidt via zshao)
+
     HADOOP-5326. Fixes CBZip2OutputStream data corruption problem.
     (Rodrigo Schmidt via zshao)
 

+ 2 - 4
src/core/org/apache/hadoop/io/compress/bzip2/CBZip2InputStream.java

@@ -51,11 +51,9 @@ import java.io.IOException;
 public class CBZip2InputStream extends InputStream implements BZip2Constants {
 
   private static void reportCRCError() throws IOException {
-    // The clean way would be to throw an exception.
-    // throw new IOException("crc error");
 
-    // Just print a message, like the previous versions of this class did
-    System.err.println("BZip2 CRC error");
+    throw new IOException("BZip2 CRC error");
+
   }
 
   private void makeMaps() {