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/zip ZipFile.java
Date Wed, 13 Aug 2003 15:14:31 GMT
peterreilly    2003/08/13 08:14:31

  Modified:    src/main/org/apache/tools/ant/types AbstractFileSet.java
                        CommandlineJava.java FilterSet.java Path.java
                        PropertySet.java XMLCatalog.java ZipScanner.java
               src/main/org/apache/tools/ant/util Watchdog.java
               src/main/org/apache/tools/ant/util/facade
                        FacadeTaskHelper.java
               src/main/org/apache/tools/zip ZipFile.java
  Log:
  remove enum variable
  PR: 22336
  Obtained from: Robert Stupp, using Jan Matèrne's checkstyle check
  
  Revision  Changes    Path
  1.25      +3 -3      ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- AbstractFileSet.java	13 Aug 2003 14:06:19 -0000	1.24
  +++ AbstractFileSet.java	13 Aug 2003 15:14:31 -0000	1.25
  @@ -466,9 +466,9 @@
               return true;
           }
   
  -        Enumeration enum = additionalPatterns.elements();
  -        while (enum.hasMoreElements()) {
  -            PatternSet ps = (PatternSet) enum.nextElement();
  +        Enumeration e = additionalPatterns.elements();
  +        while (e.hasMoreElements()) {
  +            PatternSet ps = (PatternSet) e.nextElement();
               if (ps.hasPatterns(getProject())) {
                   return true;
               }
  
  
  
  1.46      +2 -2      ant/src/main/org/apache/tools/ant/types/CommandlineJava.java
  
  Index: CommandlineJava.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/CommandlineJava.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- CommandlineJava.java	13 Aug 2003 14:06:20 -0000	1.45
  +++ CommandlineJava.java	13 Aug 2003 15:14:31 -0000	1.46
  @@ -141,8 +141,8 @@
                   }
               }
               Properties propertySets = mergePropertySets();
  -            for (Enumeration enum = propertySets.keys(); enum.hasMoreElements();) {
  -                String key = (String) enum.nextElement();
  +            for (Enumeration e = propertySets.keys(); e.hasMoreElements();) {
  +                String key = (String) e.nextElement();
                   String value = propertySets.getProperty(key);
                   listIt.add("-D" + key + "=" + value);
               }
  
  
  
  1.23      +4 -4      ant/src/main/org/apache/tools/ant/types/FilterSet.java
  
  Index: FilterSet.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/FilterSet.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- FilterSet.java	17 Jul 2003 14:17:01 -0000	1.22
  +++ FilterSet.java	13 Aug 2003 15:14:31 -0000	1.23
  @@ -324,14 +324,14 @@
                 in = new FileInputStream(filtersFile);
                 props.load(in);
   
  -              Enumeration enum = props.propertyNames();
  +              Enumeration e = props.propertyNames();
                 Vector filters = getFilters();
  -              while (enum.hasMoreElements()) {
  -                 String strPropName = (String) enum.nextElement();
  +              while (e.hasMoreElements()) {
  +                 String strPropName = (String) e.nextElement();
                    String strValue = props.getProperty(strPropName);
                    filters.addElement(new Filter(strPropName, strValue));
                 }
  -           } catch (Exception e) {
  +           } catch (Exception ex) {
                 throw new BuildException("Could not read filters from file: "
                   + filtersFile);
              } finally {
  
  
  
  1.56      +3 -3      ant/src/main/org/apache/tools/ant/types/Path.java
  
  Index: Path.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/Path.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- Path.java	3 Aug 2003 11:27:27 -0000	1.55
  +++ Path.java	13 Aug 2003 15:14:31 -0000	1.56
  @@ -490,9 +490,9 @@
               return;
           }
   
  -        Enumeration enum = elements.elements();
  -        while (enum.hasMoreElements()) {
  -            Object o = enum.nextElement();
  +        Enumeration e = elements.elements();
  +        while (e.hasMoreElements()) {
  +            Object o = e.nextElement();
               if (o instanceof Reference) {
                   o = ((Reference) o).getReferencedObject(p);
               }
  
  
  
  1.8       +6 -6      ant/src/main/org/apache/tools/ant/types/PropertySet.java
  
  Index: PropertySet.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/PropertySet.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PropertySet.java	19 Jul 2003 08:11:07 -0000	1.7
  +++ PropertySet.java	13 Aug 2003 15:14:31 -0000	1.8
  @@ -265,21 +265,21 @@
                   }
               } else if (ref.builtin != null) {
   
  -                Enumeration enum = null;
  +                Enumeration e2 = null;
                   if (ref.builtin.equals(BuiltinPropertySetName.ALL)) {
  -                    enum = properties.keys();
  +                    e2 = properties.keys();
                   } else if (ref.builtin.equals(BuiltinPropertySetName.SYSTEM)) {
  -                    enum = System.getProperties().keys();
  +                    e2 = System.getProperties().keys();
                   } else if (ref.builtin.equals(BuiltinPropertySetName
                                                 .COMMANDLINE)) {
  -                    enum = getProject().getUserProperties().keys();
  +                    e2 = getProject().getUserProperties().keys();
                   } else {
                       throw new BuildException("Impossible: Invalid builtin "
                                                + "attribute!");
                   }
   
  -                while (enum.hasMoreElements()) {
  -                    names.addElement(enum.nextElement());
  +                while (e2.hasMoreElements()) {
  +                    names.addElement(e2.nextElement());
                   }
   
               } else {
  
  
  
  1.32      +7 -7      ant/src/main/org/apache/tools/ant/types/XMLCatalog.java
  
  Index: XMLCatalog.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/XMLCatalog.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- XMLCatalog.java	13 Aug 2003 14:22:29 -0000	1.31
  +++ XMLCatalog.java	13 Aug 2003 15:14:31 -0000	1.32
  @@ -390,9 +390,9 @@
           // Add all nested elements to our catalog
           Vector newElements = catalog.getElements();
           Vector ourElements = getElements();
  -        Enumeration enum = newElements.elements();
  -        while (enum.hasMoreElements()) {
  -            ourElements.addElement(enum.nextElement());
  +        Enumeration e = newElements.elements();
  +        while (e.hasMoreElements()) {
  +            ourElements.addElement(e.nextElement());
           }
   
           // Append the classpath of the nested catalog
  @@ -630,10 +630,10 @@
        *         of the Resource or null if no such information is available.
        */
       private ResourceLocation findMatchingEntry(String publicId) {
  -        Enumeration enum = getElements().elements();
  +        Enumeration e = getElements().elements();
           ResourceLocation element = null;
  -        while (enum.hasMoreElements()) {
  -            Object o = enum.nextElement();
  +        while (e.hasMoreElements()) {
  +            Object o = e.nextElement();
               if (o instanceof ResourceLocation) {
                   element = (ResourceLocation) o;
                   if (element.getPublicId().equals(publicId)) {
  
  
  
  1.22      +3 -3      ant/src/main/org/apache/tools/ant/types/ZipScanner.java
  
  Index: ZipScanner.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/ZipScanner.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- ZipScanner.java	29 Jul 2003 09:10:07 -0000	1.21
  +++ ZipScanner.java	13 Aug 2003 15:14:31 -0000	1.22
  @@ -259,9 +259,9 @@
                   throw new BuildException("problem opening " + srcFile, ex);
               }
   
  -            Enumeration enum = zf.getEntries();
  -            while (enum.hasMoreElements()) {
  -                entry = (ZipEntry) enum.nextElement();
  +            Enumeration e = zf.getEntries();
  +            while (e.hasMoreElements()) {
  +                entry = (ZipEntry) e.nextElement();
                   myentries.put(new String(entry.getName()),
                                 new Resource(entry.getName(), true,
                                              entry.getTime(),
  
  
  
  1.6       +3 -3      ant/src/main/org/apache/tools/ant/util/Watchdog.java
  
  Index: Watchdog.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/Watchdog.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Watchdog.java	15 Jul 2003 07:19:15 -0000	1.5
  +++ Watchdog.java	13 Aug 2003 15:14:31 -0000	1.6
  @@ -90,9 +90,9 @@
       }
   
       protected final void fireTimeoutOccured() {
  -        Enumeration enum = observers.elements();
  -        while (enum.hasMoreElements()) {
  -            ((TimeoutObserver) enum.nextElement()).timeoutOccured(this);
  +        Enumeration e = observers.elements();
  +        while (e.hasMoreElements()) {
  +            ((TimeoutObserver) e.nextElement()).timeoutOccured(this);
           }
       }
   
  
  
  
  1.8       +3 -3      ant/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java
  
  Index: FacadeTaskHelper.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FacadeTaskHelper.java	19 Jul 2003 11:20:23 -0000	1.7
  +++ FacadeTaskHelper.java	13 Aug 2003 15:14:31 -0000	1.8
  @@ -152,9 +152,9 @@
        */
       public String[] getArgs() {
           Vector tmp = new Vector(args.size());
  -        for (Enumeration enum = args.elements(); enum.hasMoreElements();) {
  +        for (Enumeration e = args.elements(); e.hasMoreElements();) {
               ImplementationSpecificArgument arg =
  -                ((ImplementationSpecificArgument) enum.nextElement());
  +                ((ImplementationSpecificArgument) e.nextElement());
               String[] curr = arg.getParts(getImplementation());
               for (int i = 0; i < curr.length; i++) {
                   tmp.addElement(curr[i]);
  
  
  
  1.8       +4 -4      ant/src/main/org/apache/tools/zip/ZipFile.java
  
  Index: ZipFile.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/zip/ZipFile.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ZipFile.java	24 Jul 2003 14:20:56 -0000	1.7
  +++ ZipFile.java	13 Aug 2003 15:14:31 -0000	1.8
  @@ -429,9 +429,9 @@
        */
       private void resolveLocalFileHeaderData()
           throws IOException {
  -        Enumeration enum = getEntries();
  -        while (enum.hasMoreElements()) {
  -            ZipEntry ze = (ZipEntry) enum.nextElement();
  +        Enumeration e = getEntries();
  +        while (e.hasMoreElements()) {
  +            ZipEntry ze = (ZipEntry) e.nextElement();
               long offset = ((Long) entries.get(ze)).longValue();
               archive.seek(offset + LFH_OFFSET_FOR_FILENAME_LENGTH);
               byte[] b = new byte[2];
  
  
  

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


Mime
View raw message