Browse Source

HDFS-12264. DataNode uses a deprecated method IoUtils#cleanup. Contributed by Ajay Yadav.

Arpit Agarwal 8 years ago
parent
commit
2906c494c5

+ 3 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java

@@ -293,7 +293,9 @@ public class IOUtils {
    * @param stream the Stream to close
    */
   public static void closeStream(java.io.Closeable stream) {
-    cleanup(null, stream);
+    if (stream != null) {
+      cleanupWithLogger(null, stream);
+    }
   }
   
   /**