diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java index 10709bec0fe..97174479358 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java @@ -550,6 +550,8 @@ public class TestDFSIO implements Tool { InputStream in = (InputStream)this.stream; long actualSize = 0; while (actualSize < totalSize) { + if(bufferSize <= 0) + throw new IllegalArgumentException("buffer size should be positive integer."); int curSize = in.read(buffer, 0, bufferSize); if(curSize < 0) break; actualSize += curSize;