commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1741122 - /commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java
Date Tue, 26 Apr 2016 23:55:16 GMT
Author: ggregory
Date: Tue Apr 26 23:55:15 2016
New Revision: 1741122

URL: http://svn.apache.org/viewvc?rev=1741122&view=rev
Log:
[IO-502] Exceptions are suppressed incorrectly when copying files. Fix NPEs due to the patch.

Modified:
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java?rev=1741122&r1=1741121&r2=1741122&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java Tue Apr
26 23:55:15 2016
@@ -510,6 +510,23 @@ public class FileSystemUtils {
                         "Command line did not return any info " +
                         "for command " + Arrays.asList(cmdAttribs));
             }
+
+            inr.close();
+            inr = null;
+
+            in.close();
+            in = null;
+
+            if (out != null) {
+                out.close();
+                out = null;
+            }
+
+            if (err != null) {
+                err.close();
+                err = null;
+            }
+
             return lines;
 
         } catch (final InterruptedException ex) {



Mime
View raw message