Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 58877 invoked from network); 8 Jan 2002 19:52:50 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 8 Jan 2002 19:52:50 -0000 Received: (qmail 14987 invoked by uid 97); 8 Jan 2002 19:52:45 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 14904 invoked by uid 97); 8 Jan 2002 19:52:44 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 14853 invoked by uid 97); 8 Jan 2002 19:52:43 -0000 Date: 8 Jan 2002 19:52:36 -0000 Message-ID: <20020108195236.90524.qmail@icarus.apache.org> From: sbailliez@apache.org To: jakarta-ant-cvs@apache.org Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Zip.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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: For additional commands, e-mail: