ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r416181 - /ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunner.java
Date Thu, 22 Jun 2006 00:04:27 GMT
Author: stevel
Date: Wed Jun 21 17:04:26 2006
New Revision: 416181

URL: http://svn.apache.org/viewvc?rev=416181&view=rev
Log:
FileUtils.close

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunner.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunner.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunner.java?rev=416181&r1=416180&r2=416181&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunner.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunner.java Wed Jun 21 17:04:26
2006
@@ -173,13 +173,14 @@
 
         int count = (int) file.length();
         byte[] data = new byte[count];
-
+        FileInputStream inStream = null;
         try {
-            FileInputStream inStream = new FileInputStream(file);
+            inStream = new FileInputStream(file);
             inStream.read(data);
-            inStream.close();
         } catch (IOException e) {
             throw new BuildException(e);
+        } finally {
+            FileUtils.close(inStream);
         }
 
         script += new String(data);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message