ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Delete.java
Date Tue, 08 Jan 2002 22:42:23 GMT
sbailliez    02/01/08 14:42:23

  Modified:    src/main/org/apache/tools/ant/taskdefs Delete.java
  Log:
  Fix bad coding style.
  then/else parts of if statement and loop body must always been enclosed
  in a block statement.
  
  Revision  Changes    Path
  1.22      +18 -11    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Delete.java
  
  Index: Delete.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Delete.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Delete.java	8 Jan 2002 20:46:27 -0000	1.21
  +++ Delete.java	8 Jan 2002 22:42:23 -0000	1.22
  @@ -266,11 +266,12 @@
   
                       if (!file.delete()) {
                           String message="Unable to delete file " + file.getAbsolutePath();
  -                        if(failonerror)
  +                        if(failonerror) {
                               throw new BuildException(message);
  -                        else 
  +                        } else { 
                               log(message, 
                                   quiet ? Project.MSG_VERBOSE : Project.MSG_WARN);
  +                        }
                       }
                   }
               } else {
  @@ -337,7 +338,9 @@
   
       protected void removeDir(File d) {
           String[] list = d.list();
  -        if (list == null) list = new String[0];
  +        if (list == null) {
  +          list = new String[0];
  +        }
           for (int i = 0; i < list.length; i++) {
               String s = list[i];
               File f = new File(d, s);
  @@ -347,22 +350,24 @@
                   log("Deleting " + f.getAbsolutePath(), verbosity);
                   if (!f.delete()) {
                       String message="Unable to delete file " + f.getAbsolutePath();
  -                    if(failonerror)
  +                    if(failonerror) {
                           throw new BuildException(message);
  -                    else
  +                    } else {
                           log(message,
                               quiet ? Project.MSG_VERBOSE : Project.MSG_WARN);
  +                    }
                   }
               }
           }
           log("Deleting directory " + d.getAbsolutePath(), verbosity);
           if (!d.delete()) {
               String message="Unable to delete directory " + dir.getAbsolutePath();
  -            if(failonerror)
  +            if(failonerror) {
                   throw new BuildException(message);
  -            else
  +            } else {
                   log(message,
                       quiet ? Project.MSG_VERBOSE : Project.MSG_WARN);
  +            }
           }
       }
   
  @@ -381,11 +386,12 @@
                   log("Deleting " + f.getAbsolutePath(), verbosity);
                   if (!f.delete()) {
                       String message="Unable to delete file " + f.getAbsolutePath();
  -                    if(failonerror)
  +                    if(failonerror) {
                           throw new BuildException(message);
  -                    else
  +                    } else {
                           log(message,
                               quiet ? Project.MSG_VERBOSE : Project.MSG_WARN);
  +                    }
                   }
               }
           }
  @@ -400,11 +406,12 @@
                       if (!dir.delete()) {
                           String message="Unable to delete directory "
                                   + dir.getAbsolutePath();
  -                        if(failonerror)
  +                        if(failonerror) {
                               throw new BuildException(message);
  -                        else
  +                        } else {
                               log(message,
                                   quiet ? Project.MSG_VERBOSE : Project.MSG_WARN);
  +                        }
                       } else {
                           dirCount++;
                       }
  
  
  

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


Mime
View raw message