tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util Enumerator.java
Date Tue, 12 Aug 2003 19:56:53 GMT
luehe       2003/08/12 12:56:53

  Modified:    catalina/src/share/org/apache/catalina/util Enumerator.java
  Log:
  - Fixed logic so that iterator actually gets cloned when "clone" is set to
    TRUE.
  - Replaced LinkedList with more efficient ArrayList.
  
  Revision  Changes    Path
  1.3       +8 -8      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/Enumerator.java
  
  Index: Enumerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/Enumerator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Enumerator.java	29 Apr 2003 21:51:51 -0000	1.2
  +++ Enumerator.java	12 Aug 2003 19:56:53 -0000	1.3
  @@ -69,7 +69,7 @@
   import java.util.Enumeration;
   import java.util.Iterator;
   import java.util.List;
  -import java.util.LinkedList;
  +import java.util.ArrayList;
   import java.util.Map;
   import java.util.NoSuchElementException;
   
  @@ -139,11 +139,11 @@
       public Enumerator(Iterator iterator, boolean clone) {
   
           super();
  -        if (clone) {
  +        if (!clone) {
               this.iterator = iterator;
           } else {
  -            List list = new LinkedList();
  -            while(iterator.hasNext()) {
  +            List list = new ArrayList();
  +            while (iterator.hasNext()) {
                   list.add(iterator.next());
               }
               this.iterator = list.iterator();   
  
  
  

Mime
View raw message