浏览代码

HADOOP-695. Fix a NullPointerException in contrib/streaming.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@475393 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 年之前
父节点
当前提交
14f6cab132

+ 3 - 0
CHANGES.txt

@@ -85,6 +85,9 @@ Trunk (unreleased changes)
     to be smaller than the buffer size, typically only when debugging.
     (Milind Bhandarkar via cutting)
 
+26. HADOOP-695.  Fix a NullPointerException in contrib/streaming.
+    (Hairong Kuang via cutting)
+
 
 Release 0.8.0 - 2006-11-03
 

+ 1 - 1
src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamLineRecordReader.java

@@ -97,13 +97,13 @@ public class StreamLineRecordReader extends StreamBaseRecordReader {
       }
 
       line = UTF8ByteArrayUtils.readLine((InputStream) in_);
+      if (line == null) return false;
       try {
         Text.validateUTF8(line);
       } catch (MalformedInputException m) {
         System.err.println("line=" + line + "|" + new Text(line));
         System.out.flush();
       }
-      if (line == null) return false;
       try {
         int tab = UTF8ByteArrayUtils.findTab(line);
         if (tab == -1) {