ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Jikes.java Concat.java
Date Sun, 22 May 2005 19:28:13 GMT
jkf         2005/05/22 12:28:13

  Modified:    src/testcases/org/apache/tools/ant/taskdefs ConcatTest.java
                        ExecuteOnTest.java StyleTest.java ExecTaskTest.java
               src/testcases/org/apache/tools/ant/filters
                        DynamicFilterTest.java TokenFilterTest.java
               src/main/org/apache/tools/ant/taskdefs/optional/jdepend
                        JDependTask.java
               src/main/org/apache/tools/ant/taskdefs Jikes.java
                        Concat.java
  Log:
  Removing constructs to close streams that catch Throwable -> FileUtils.close.
  
  Revision  Changes    Path
  1.14      +1 -1      ant/src/testcases/org/apache/tools/ant/taskdefs/ConcatTest.java
  
  Index: ConcatTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ConcatTest.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ConcatTest.java	6 Jan 2005 12:05:04 -0000	1.13
  +++ ConcatTest.java	22 May 2005 19:28:13 -0000	1.14
  @@ -246,7 +246,7 @@
               return  FileUtils.readFully(r);
           }
           finally {
  -            try {r.close();} catch (Throwable ignore) {}
  +            FileUtils.close(r);
           }
   
       }
  
  
  
  1.12      +1 -6      ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java
  
  Index: ExecuteOnTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ExecuteOnTest.java	26 Jan 2005 07:50:48 -0000	1.11
  +++ ExecuteOnTest.java	22 May 2005 19:28:13 -0000	1.12
  @@ -570,12 +570,7 @@
               reader = new FileReader(getProject().resolveFile(filename));
               result = FileUtils.readFully(reader);
           } finally {
  -            if (reader != null) {
  -                try {
  -                    reader.close();
  -                } catch (Throwable ignore) {
  -                }
  -            }
  +            FileUtils.close(reader);
           }
           return result;
       }
  
  
  
  1.16      +1 -1      ant/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java
  
  Index: StyleTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- StyleTest.java	28 Mar 2005 23:22:12 -0000	1.15
  +++ StyleTest.java	22 May 2005 19:28:13 -0000	1.16
  @@ -124,7 +124,7 @@
               return  FileUtils.readFully(r);
           }
           finally {
  -            try {r.close();} catch (Throwable ignore) {}
  +            FileUtils.close(r);
           }
   
       }
  
  
  
  1.20      +1 -6      ant/src/testcases/org/apache/tools/ant/taskdefs/ExecTaskTest.java
  
  Index: ExecTaskTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ExecTaskTest.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- ExecTaskTest.java	19 Apr 2005 22:26:37 -0000	1.19
  +++ ExecTaskTest.java	22 May 2005 19:28:13 -0000	1.20
  @@ -482,12 +482,7 @@
               result = FileUtils.readFully(reader);
           } catch (IOException eyeOhEx) {
           } finally {
  -            if (reader != null) {
  -                try {
  -                    reader.close();
  -                } catch (Throwable ignore) {
  -                }
  -            }
  +            FileUtils.close(reader);
           }
           return result;
       }
  
  
  
  1.7       +1 -1      ant/src/testcases/org/apache/tools/ant/filters/DynamicFilterTest.java
  
  Index: DynamicFilterTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/filters/DynamicFilterTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DynamicFilterTest.java	16 Dec 2004 14:01:37 -0000	1.6
  +++ DynamicFilterTest.java	22 May 2005 19:28:13 -0000	1.7
  @@ -71,7 +71,7 @@
               return  FileUtils.readFully(r);
           }
           finally {
  -            try {r.close();} catch (Throwable ignore) {}
  +            FileUtils.close(r);
           }
   
       }
  
  
  
  1.10      +1 -1      ant/src/testcases/org/apache/tools/ant/filters/TokenFilterTest.java
  
  Index: TokenFilterTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/filters/TokenFilterTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TokenFilterTest.java	16 Dec 2004 14:01:37 -0000	1.9
  +++ TokenFilterTest.java	22 May 2005 19:28:13 -0000	1.10
  @@ -251,7 +251,7 @@
               return  FileUtils.readFully(r);
           }
           finally {
  -            try {r.close();} catch (Throwable ignore) {}
  +            FileUtils.close(r);
           }
   
       }
  
  
  
  1.34      +2 -7      ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- JDependTask.java	13 Dec 2004 09:06:19 -0000	1.33
  +++ JDependTask.java	22 May 2005 19:28:13 -0000	1.34
  @@ -37,6 +37,7 @@
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.PatternSet;
   import org.apache.tools.ant.types.Reference;
  +import org.apache.tools.ant.util.FileUtils;
   import org.apache.tools.ant.util.LoaderUtils;
   
   /**
  @@ -551,13 +552,7 @@
   
               jdepend.analyze();
           } finally {
  -            if (fw != null) {
  -                try {
  -                    fw.close();
  -                } catch (Throwable t) {
  -                    // Ignore
  -                }
  -            }
  +            FileUtils.close(fw);
           }
           return SUCCESS;
       }
  
  
  
  1.24      +3 -7      ant/src/main/org/apache/tools/ant/taskdefs/Jikes.java
  
  Index: Jikes.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Jikes.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Jikes.java	14 Mar 2005 10:04:58 -0000	1.23
  +++ Jikes.java	22 May 2005 19:28:13 -0000	1.24
  @@ -21,8 +21,10 @@
   import java.io.IOException;
   import java.io.PrintWriter;
   import java.util.Random;
  +
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
  +import org.apache.tools.ant.util.FileUtils;
   
   /**
    * Encapsulates a Jikes compiler, by directly executing an external
  @@ -94,13 +96,7 @@
                       throw new BuildException("Error creating temporary file",
                                                e);
                   } finally {
  -                    if (out != null) {
  -                        try {
  -                            out.close();
  -                        } catch (Throwable t) {
  -                            // ignore
  -                        }
  -                    }
  +                    FileUtils.close(out);
                   }
               } else {
                   commandArray = new String[args.length + 1];
  
  
  
  1.43      +3 -14     ant/src/main/org/apache/tools/ant/taskdefs/Concat.java
  
  Index: Concat.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Concat.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- Concat.java	10 Mar 2005 12:50:57 -0000	1.42
  +++ Concat.java	22 May 2005 19:28:13 -0000	1.43
  @@ -523,13 +523,8 @@
                   in = null;
               }
           } finally {
  -            if (in != null) {
  -                try {
  -                    in.close();
  -                } catch (Throwable t) {
  -                    // Ignore
  -                }
  -            }
  +            FileUtils.close(in);
  +
               if (out != null) {
                   try {
                       out.close();
  @@ -730,13 +725,7 @@
               } catch (IOException ex) {
                   throw new BuildException(ex);
               } finally {
  -                if (reader != null) {
  -                    try {
  -                        reader.close();
  -                    } catch (Throwable t) {
  -                        // ignore
  -                    }
  -                }
  +                FileUtils.close(reader);
               }
           }
   
  
  
  

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


Mime
View raw message