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 Zip.java
Date Tue, 08 Jan 2002 19:52:36 GMT
sbailliez    02/01/08 11:52:36

  Modified:    src/main/org/apache/tools/ant/taskdefs Zip.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.58      +15 -7     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Zip.java
  
  Index: Zip.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- Zip.java	7 Jan 2002 06:20:56 -0000	1.57
  +++ Zip.java	8 Jan 2002 19:52:36 -0000	1.58
  @@ -346,8 +346,9 @@
                       // before we added any files, then we must swallow this exception.
Otherwise,
                       // the error that's reported will be the close() error, which is not
the real
                       // cause of the problem.
  -                    if (success)
  +                    if (success) {
                           throw ex;
  +                    }
                   }
               }
           } catch (IOException ioe) {
  @@ -395,15 +396,17 @@
        */
       protected void addFiles(FileScanner scanner, ZipOutputStream zOut,
                               String prefix, String fullpath) throws IOException {
  -        if (prefix.length() > 0 && fullpath.length() > 0)
  +        if (prefix.length() > 0 && fullpath.length() > 0) {
               throw new BuildException("Both prefix and fullpath attributes may not be set
on the same fileset.");
  +        }
   
           File thisBaseDir = scanner.getBasedir();
   
           // directories that matched include patterns
           String[] dirs = scanner.getIncludedDirectories();
  -        if (dirs.length > 0 && fullpath.length() > 0)
  +        if (dirs.length > 0 && fullpath.length() > 0) {
               throw new BuildException("fullpath attribute may only be specified for filesets
that specify a single file.");
  +        }
           for (int i = 0; i < dirs.length; i++) {
               if ("".equals(dirs[i])) {
                   continue;
  @@ -417,8 +420,9 @@
   
           // files that matched include patterns
           String[] files = scanner.getIncludedFiles();
  -        if (files.length > 1 && fullpath.length() > 0)
  +        if (files.length > 1 && fullpath.length() > 0) {
               throw new BuildException("fullpath attribute may only be specified for filesets
that specify a single file.");
  +        }
           for (int i = 0; i < files.length; i++) {
               File f = new File(thisBaseDir, files[i]);
               if (fullpath.length() > 0)
  @@ -441,8 +445,9 @@
                                    ZipOutputStream zOut, String prefix, String fullpath)
           throws IOException
       {
  -        if (prefix.length() > 0 && fullpath.length() > 0)
  +        if (prefix.length() > 0 && fullpath.length() > 0) {
               throw new BuildException("Both prefix and fullpath attributes may not be set
on the same fileset.");
  +        }
   
           ZipScanner zipScanner = (ZipScanner) ds;
           File zipSrc = fs.getSrc();
  @@ -547,7 +552,9 @@
                   }
               }
   
  -            if (!zipFile.exists()) return false;
  +            if (!zipFile.exists()) {
  +              return false;
  +            }
   
               SourceFileScanner sfs = new SourceFileScanner(this);
               MergingMapper mm = new MergingMapper();
  @@ -571,8 +578,9 @@
           Vector files = new Vector();
           for (int i = 0; i < fileNames.length; i++) {
               File thisBaseDir = scanners[i].getBasedir();
  -            for (int j = 0; j < fileNames[i].length; j++)
  +            for (int j = 0; j < fileNames[i].length; j++) {
                   files.addElement(new File(thisBaseDir, fileNames[i][j]));
  +            }
           }
           File[] toret = new File[files.size()];
           files.copyInto(toret);
  
  
  

--
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