ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/util FileUtils.java
Date Wed, 15 Dec 2004 12:10:43 GMT
bodewig     2004/12/15 04:10:43

  Modified:    src/main/org/apache/tools/ant/util FileUtils.java
  Log:
  Use close method to close streams, Submitted by Kevin Jackson
  
  Revision  Changes    Path
  1.79      +6 -18     ant/src/main/org/apache/tools/ant/util/FileUtils.java
  
  Index: FileUtils.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/FileUtils.java,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- FileUtils.java	14 Dec 2004 17:56:34 -0000	1.78
  +++ FileUtils.java	15 Dec 2004 12:10:43 -0000	1.79
  @@ -614,9 +614,9 @@
                            }
                            out.write(buffer, 0, nRead);
                         }
  -                  } finally {
  -                      close(out);
  -                      close(in);
  +                 } finally {
  +                     close(out);
  +                     close(in);
                    }
               } else {
                   FileInputStream in = null;
  @@ -1012,20 +1012,8 @@
               }
               return true;
           } finally {
  -            if (in1 != null) {
  -                try {
  -                    in1.close();
  -                } catch (IOException e) {
  -                    // ignore
  -                }
  -            }
  -            if (in2 != null) {
  -                try {
  -                    in2.close();
  -                } catch (IOException e) {
  -                    // ignore
  -                }
  -            }
  +            close(in1);
  +            close(in2);
           }
       }
   
  
  
  

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


Mime
View raw message