ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types PatternSet.java
Date Sat, 06 Oct 2001 01:07:20 GMT
donaldp     01/10/05 18:07:20

  Modified:    src/main/org/apache/tools/ant/types PatternSet.java
  Log:
  Make sure file for reading patterns is closed.
  
  Submitted by: tbsandee@pobox.com (Ben Sandee)
  
  Revision  Changes    Path
  1.12      +10 -1     jakarta-ant/src/main/org/apache/tools/ant/types/PatternSet.java
  
  Index: PatternSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/PatternSet.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PatternSet.java	2001/08/09 03:32:08	1.11
  +++ PatternSet.java	2001/10/06 01:07:20	1.12
  @@ -277,9 +277,10 @@
       private void readPatterns(File patternfile, Vector patternlist, Project p)
           throws BuildException {
           
  +        BufferedReader patternReader = null;
           try {
               // Get a FileReader
  -            BufferedReader patternReader = 
  +            patternReader = 
                   new BufferedReader(new FileReader(patternfile)); 
           
               // Create one NameEntry in the appropriate pattern list for each 
  @@ -297,6 +298,14 @@
               String msg = "An error occured while reading from pattern file: " 
                   + patternfile;
               throw new BuildException(msg, ioe);
  +        } finally {
  +            if( null != patternReader ) {
  +                try {
  +                    patternReader.close();
  +                } catch(IOException ioe) { 
  +                    //Ignore exception
  +                }
  +            }
           }
       }
   
  
  
  

Mime
View raw message