ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Ant.java AntStructure.java Concat.java Copydir.java Expand.java Jar.java Javadoc.java Replace.java UpToDate.java Zip.java
Date Wed, 13 Aug 2003 14:46:15 GMT
peterreilly    2003/08/13 07:46:15

  Modified:    src/main/org/apache/tools/ant ComponentHelper.java
                        RuntimeConfigurable.java Task.java
               src/main/org/apache/tools/ant/input DefaultInputHandler.java
               src/main/org/apache/tools/ant/taskdefs Ant.java
                        AntStructure.java Concat.java Copydir.java
                        Expand.java Jar.java Javadoc.java Replace.java
                        UpToDate.java Zip.java
  Log:
  removing enum variable
  PR: 22345
  
  Revision  Changes    Path
  1.23      +6 -6      ant/src/main/org/apache/tools/ant/ComponentHelper.java
  
  Index: ComponentHelper.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ComponentHelper.java	13 Aug 2003 14:06:19 -0000	1.22
  +++ ComponentHelper.java	13 Aug 2003 14:46:15 -0000	1.23
  @@ -746,9 +746,9 @@
               }
               props.load(in);
   
  -            Enumeration enum = props.propertyNames();
  -            while (enum.hasMoreElements()) {
  -                String name = (String) enum.nextElement();
  +            Enumeration e = props.propertyNames();
  +            while (e.hasMoreElements()) {
  +                String name = (String) e.nextElement();
                   String className = props.getProperty(name);
                   AntTypeDefinition def = new AntTypeDefinition();
                   def.setName(name);
  @@ -791,9 +791,9 @@
               }
               props.load(in);
   
  -            Enumeration enum = props.propertyNames();
  -            while (enum.hasMoreElements()) {
  -                String name = (String) enum.nextElement();
  +            Enumeration e = props.propertyNames();
  +            while (e.hasMoreElements()) {
  +                String name = (String) e.nextElement();
                   String className = props.getProperty(name);
                   AntTypeDefinition def = new AntTypeDefinition();
                   def.setName(name);
  
  
  
  1.44      +3 -3      ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java
  
  Index: RuntimeConfigurable.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- RuntimeConfigurable.java	13 Aug 2003 13:18:54 -0000	1.43
  +++ RuntimeConfigurable.java	13 Aug 2003 14:46:15 -0000	1.44
  @@ -419,10 +419,10 @@
               ProjectHelper.addText(p, wrappedObject, characters.substring(0));
           }
   
  -        Enumeration enum = getChildren();
  -        while (enum.hasMoreElements()) {
  +        Enumeration e = getChildren();
  +        while (e.hasMoreElements()) {
               RuntimeConfigurable child
  -                    = (RuntimeConfigurable) enum.nextElement();
  +                    = (RuntimeConfigurable) e.nextElement();
               if (child.wrappedObject instanceof Task) {
                   Task childTask = (Task) child.wrappedObject;
                   childTask.setRuntimeConfigurableWrapper(child);
  
  
  
  1.48      +3 -3      ant/src/main/org/apache/tools/ant/Task.java
  
  Index: Task.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Task.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- Task.java	1 Aug 2003 10:22:30 -0000	1.47
  +++ Task.java	13 Aug 2003 14:46:15 -0000	1.48
  @@ -474,10 +474,10 @@
        */
       private void replaceChildren(RuntimeConfigurable wrapper,
                                    UnknownElement parentElement) {
  -        Enumeration enum = wrapper.getChildren();
  -        while (enum.hasMoreElements()) {
  +        Enumeration e = wrapper.getChildren();
  +        while (e.hasMoreElements()) {
               RuntimeConfigurable childWrapper =
  -                (RuntimeConfigurable) enum.nextElement();
  +                (RuntimeConfigurable) e.nextElement();
               UnknownElement childElement =
                   new UnknownElement(childWrapper.getElementTag());
               parentElement.addChild(childElement);
  
  
  
  1.12      +4 -4      ant/src/main/org/apache/tools/ant/input/DefaultInputHandler.java
  
  Index: DefaultInputHandler.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/input/DefaultInputHandler.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DefaultInputHandler.java	25 Jul 2003 18:44:39 -0000	1.11
  +++ DefaultInputHandler.java	13 Aug 2003 14:46:15 -0000	1.12
  @@ -124,14 +124,14 @@
           if (request instanceof MultipleChoiceInputRequest) {
               StringBuffer sb = new StringBuffer(prompt);
               sb.append("(");
  -            Enumeration enum =
  +            Enumeration e =
                   ((MultipleChoiceInputRequest) request).getChoices().elements();
               boolean first = true;
  -            while (enum.hasMoreElements()) {
  +            while (e.hasMoreElements()) {
                   if (!first) {
                       sb.append(",");
                   }
  -                sb.append(enum.nextElement());
  +                sb.append(e.nextElement());
                   first = false;
               }
               sb.append(")");
  
  
  
  1.85      +4 -4      ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
  
  Index: Ant.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- Ant.java	5 Aug 2003 11:47:33 -0000	1.84
  +++ Ant.java	13 Aug 2003 14:46:15 -0000	1.85
  @@ -384,16 +384,16 @@
           } finally {
               // help the gc
               newProject = null;
  -            Enumeration enum = properties.elements();
  -            while (enum.hasMoreElements()) {
  -                Property p = (Property) enum.nextElement();
  +            Enumeration e = properties.elements();
  +            while (e.hasMoreElements()) {
  +                Property p = (Property) e.nextElement();
                   p.setProject(null);
               }
   
               if (output != null && out != null) {
                   try {
                       out.close();
  -                } catch (final Exception e) {
  +                } catch (final Exception ex) {
                       //ignore
                   }
               }
  
  
  
  1.36      +7 -7      ant/src/main/org/apache/tools/ant/taskdefs/AntStructure.java
  
  Index: AntStructure.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/AntStructure.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- AntStructure.java	24 Jul 2003 14:07:51 -0000	1.35
  +++ AntStructure.java	13 Aug 2003 14:46:15 -0000	1.36
  @@ -272,9 +272,9 @@
               v.addElement(TASKS);
           }
   
  -        Enumeration enum = ih.getNestedElements();
  -        while (enum.hasMoreElements()) {
  -            v.addElement(enum.nextElement());
  +        Enumeration e = ih.getNestedElements();
  +        while (e.hasMoreElements()) {
  +            v.addElement(e.nextElement());
           }
   
           if (v.isEmpty()) {
  @@ -300,9 +300,9 @@
           sb.append(name);
           sb.append(lSep).append("          id ID #IMPLIED");
   
  -        enum = ih.getAttributes();
  -        while (enum.hasMoreElements()) {
  -            String attrName = (String) enum.nextElement();
  +        e = ih.getAttributes();
  +        while (e.hasMoreElements()) {
  +            String attrName = (String) e.nextElement();
               if ("id".equals(attrName)) {
                 continue;
               }
  
  
  
  1.26      +3 -3      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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Concat.java	25 Jul 2003 16:23:15 -0000	1.25
  +++ Concat.java	13 Aug 2003 14:46:15 -0000	1.26
  @@ -304,12 +304,12 @@
        * Specify the end of line to find and to add if
        * not present at end of each input file. This attribute
        * is used in conjuction with fixlastline.
  -     * @param enum the type of new line to add -
  +     * @param crlf the type of new line to add -
        *              cr, mac, lf, unix, crlf, or dos
        * @since Ant 1.6
        */
  -    public void setEol(FixCRLF.CrLf enum) {
  -        String s = enum.getValue();
  +    public void setEol(FixCRLF.CrLf crlf) {
  +        String s = crlf.getValue();
           if (s.equals("cr") || s.equals("mac")) {
               eolString = "\r";
           } else if (s.equals("lf") || s.equals("unix")) {
  
  
  
  1.30      +3 -3      ant/src/main/org/apache/tools/ant/taskdefs/Copydir.java
  
  Index: Copydir.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Copydir.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- Copydir.java	25 Jul 2003 16:26:51 -0000	1.29
  +++ Copydir.java	13 Aug 2003 14:46:15 -0000	1.30
  @@ -142,9 +142,9 @@
                   log("Copying " + filecopyList.size() + " file"
                       + (filecopyList.size() == 1 ? "" : "s")
                       + " to " + destDir.getAbsolutePath());
  -                Enumeration enum = filecopyList.keys();
  -                while (enum.hasMoreElements()) {
  -                    String fromFile = (String) enum.nextElement();
  +                Enumeration e = filecopyList.keys();
  +                while (e.hasMoreElements()) {
  +                    String fromFile = (String) e.nextElement();
                       String toFile = (String) filecopyList.get(fromFile);
                       try {
                           getProject().copyFile(fromFile, toFile, filtering,
  
  
  
  1.49      +3 -3      ant/src/main/org/apache/tools/ant/taskdefs/Expand.java
  
  Index: Expand.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Expand.java,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- Expand.java	19 Jul 2003 08:10:59 -0000	1.48
  +++ Expand.java	13 Aug 2003 14:46:15 -0000	1.49
  @@ -156,9 +156,9 @@
           ZipFile zf = null;
           try {
               zf = new ZipFile(srcF, encoding);
  -            Enumeration enum = zf.getEntries();
  -            while (enum.hasMoreElements()) {
  -                ZipEntry ze = (ZipEntry) enum.nextElement();
  +            Enumeration e = zf.getEntries();
  +            while (e.hasMoreElements()) {
  +                ZipEntry ze = (ZipEntry) e.nextElement();
                   extractFile(fileUtils, srcF, dir, zf.getInputStream(ze),
                               ze.getName(), new Date(ze.getTime()),
                               ze.isDirectory());
  
  
  
  1.80      +9 -9      ant/src/main/org/apache/tools/ant/taskdefs/Jar.java
  
  Index: Jar.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Jar.java,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- Jar.java	19 Jul 2003 11:20:12 -0000	1.79
  +++ Jar.java	13 Aug 2003 14:46:15 -0000	1.80
  @@ -273,9 +273,9 @@
   
               // must not use getEntry as "well behaving" applications
               // must accept the manifest in any capitalization
  -            Enumeration enum = zf.entries();
  -            while (enum.hasMoreElements()) {
  -                ZipEntry ze = (ZipEntry) enum.nextElement();
  +            Enumeration e = zf.entries();
  +            while (e.hasMoreElements()) {
  +                ZipEntry ze = (ZipEntry) e.nextElement();
                   if (ze.getName().equalsIgnoreCase(MANIFEST_NAME)) {
                       InputStreamReader isr =
                           new InputStreamReader(zf.getInputStream(ze), "UTF-8");
  @@ -448,9 +448,9 @@
           // JarIndex is sorting the directories by ascending order.
           // it's painful to do in JDK 1.1 and it has no value but cosmetic
           // since it will be read into a hashtable by the classloader.
  -        Enumeration enum = addedDirs.keys();
  -        while (enum.hasMoreElements()) {
  -            String dir = (String) enum.nextElement();
  +        Enumeration e = addedDirs.keys();
  +        while (e.hasMoreElements()) {
  +            String dir = (String) e.nextElement();
   
               // try to be smart, not to be fooled by a weird directory name
               // @fixme do we need to check for directories starting by ./ ?
  @@ -470,9 +470,9 @@
               writer.println(dir);
           }
   
  -        enum = rootEntries.elements();
  -        while (enum.hasMoreElements()) {
  -            writer.println(enum.nextElement());
  +        e = rootEntries.elements();
  +        while (e.hasMoreElements()) {
  +            writer.println(e.nextElement());
           }
   
           writer.flush();
  
  
  
  1.123     +18 -18    ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  
  Index: Javadoc.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
  retrieving revision 1.122
  retrieving revision 1.123
  diff -u -r1.122 -r1.123
  --- Javadoc.java	1 Aug 2003 10:08:12 -0000	1.122
  +++ Javadoc.java	13 Aug 2003 14:46:15 -0000	1.123
  @@ -1927,9 +1927,9 @@
                                                                  true));
               }
   
  -            Enumeration enum = packagesToDoc.elements();
  -            while (enum.hasMoreElements()) {
  -                String packageName = (String) enum.nextElement();
  +            Enumeration e = packagesToDoc.elements();
  +            while (e.hasMoreElements()) {
  +                String packageName = (String) e.nextElement();
                   if (useExternalFile) {
                       srcListWriter.println(packageName);
                   } else {
  @@ -1937,9 +1937,9 @@
                   }
               }
   
  -            enum = sourceFilesToDoc.elements();
  -            while (enum.hasMoreElements()) {
  -                SourceFile sf = (SourceFile) enum.nextElement();
  +            e = sourceFilesToDoc.elements();
  +            while (e.hasMoreElements()) {
  +                SourceFile sf = (SourceFile) e.nextElement();
                   String sourceFileName = sf.getFile().getAbsolutePath();
                   if (useExternalFile) {
                       if (javadoc4 && sourceFileName.indexOf(" ") > -1) {
  @@ -2013,9 +2013,9 @@
        * @since 1.5
        */
       private void addFileSets(Vector sf) {
  -        Enumeration enum = fileSets.elements();
  -        while (enum.hasMoreElements()) {
  -            FileSet fs = (FileSet) enum.nextElement();
  +        Enumeration e = fileSets.elements();
  +        while (e.hasMoreElements()) {
  +            FileSet fs = (FileSet) e.nextElement();
               if (!fs.hasPatterns() && !fs.hasSelectors()) {
                   fs = (FileSet) fs.clone();
                   fs.createInclude().setName("**/*.java");
  @@ -2047,9 +2047,9 @@
           // and nested excludepackage elements
           if (sourcePath != null && packageNames.size() > 0) {
               PatternSet ps = new PatternSet();
  -            Enumeration enum = packageNames.elements();
  -            while (enum.hasMoreElements()) {
  -                PackageName p = (PackageName) enum.nextElement();
  +            Enumeration e = packageNames.elements();
  +            while (e.hasMoreElements()) {
  +                PackageName p = (PackageName) e.nextElement();
                   String pkg = p.getName().replace('.', '/');
                   if (pkg.endsWith("*")) {
                       pkg += "*";
  @@ -2057,9 +2057,9 @@
                   ps.createInclude().setName(pkg);
               }
   
  -            enum = excludePackageNames.elements();
  -            while (enum.hasMoreElements()) {
  -                PackageName p = (PackageName) enum.nextElement();
  +            e = excludePackageNames.elements();
  +            while (e.hasMoreElements()) {
  +                PackageName p = (PackageName) e.nextElement();
                   String pkg = p.getName().replace('.', '/');
                   if (pkg.endsWith("*")) {
                       pkg += "*";
  @@ -2078,9 +2078,9 @@
               }
           }
   
  -        Enumeration enum = dirSets.elements();
  -        while (enum.hasMoreElements()) {
  -            DirSet ds = (DirSet) enum.nextElement();
  +        Enumeration e = dirSets.elements();
  +        while (e.hasMoreElements()) {
  +            DirSet ds = (DirSet) e.nextElement();
               File baseDir = ds.getDir(getProject());
               log("scanning " + baseDir + " for packages.", Project.MSG_DEBUG);
               DirectoryScanner dsc = ds.getDirectoryScanner(getProject());
  
  
  
  1.47      +3 -3      ant/src/main/org/apache/tools/ant/taskdefs/Replace.java
  
  Index: Replace.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Replace.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- Replace.java	28 Jul 2003 00:22:00 -0000	1.46
  +++ Replace.java	13 Aug 2003 14:46:15 -0000	1.47
  @@ -271,9 +271,9 @@
           try {
               if (replaceFilterFile != null) {
                   Properties props = getProperties(replaceFilterFile);
  -                Enumeration enum = props.keys();
  -                while (enum.hasMoreElements()) {
  -                    String token =  enum.nextElement().toString();
  +                Enumeration e = props.keys();
  +                while (e.hasMoreElements()) {
  +                    String token =  e.nextElement().toString();
                       Replacefilter replaceFilter = createReplacefilter();
                       replaceFilter.setToken(token);
                       replaceFilter.setValue(props.getProperty(token));
  
  
  
  1.32      +3 -3      ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java
  
  Index: UpToDate.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- UpToDate.java	19 Jul 2003 11:20:13 -0000	1.31
  +++ UpToDate.java	13 Aug 2003 14:46:15 -0000	1.32
  @@ -194,10 +194,10 @@
                                        + " not found.");
           }
   
  -        Enumeration enum = sourceFileSets.elements();
  +        Enumeration e = sourceFileSets.elements();
           boolean upToDate = true;
  -        while (upToDate && enum.hasMoreElements()) {
  -            FileSet fs = (FileSet) enum.nextElement();
  +        while (upToDate && e.hasMoreElements()) {
  +            FileSet fs = (FileSet) e.nextElement();
               DirectoryScanner ds = fs.getDirectoryScanner(getProject());
               upToDate = upToDate && scanDir(fs.getDir(getProject()),
                                              ds.getIncludedFiles());
  
  
  
  1.115     +3 -3      ant/src/main/org/apache/tools/ant/taskdefs/Zip.java
  
  Index: Zip.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
  retrieving revision 1.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- Zip.java	5 Aug 2003 16:13:02 -0000	1.114
  +++ Zip.java	13 Aug 2003 14:46:15 -0000	1.115
  @@ -1139,9 +1139,9 @@
           entries.clear();
           addingNewFiles = false;
           doUpdate = savedDoUpdate;
  -        Enumeration enum = filesetsFromGroupfilesets.elements();
  -        while (enum.hasMoreElements()) {
  -            ZipFileSet zf = (ZipFileSet) enum.nextElement();
  +        Enumeration e = filesetsFromGroupfilesets.elements();
  +        while (e.hasMoreElements()) {
  +            ZipFileSet zf = (ZipFileSet) e.nextElement();
               filesets.removeElement(zf);
           }
           filesetsFromGroupfilesets.removeAllElements();
  
  
  

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


Mime
View raw message