ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/util CollectionUtils.java
Date Mon, 07 Jul 2003 08:20:52 GMT
bodewig     2003/07/07 01:20:52

  Modified:    src/main/org/apache/tools/ant RuntimeConfigurable.java
                        Target.java
               src/main/org/apache/tools/ant/util CollectionUtils.java
  Log:
  Move EmptyEnumeration to CollectionUtils
  
  Revision  Changes    Path
  1.39      +2 -12     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.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- RuntimeConfigurable.java	6 Jul 2003 09:57:34 -0000	1.38
  +++ RuntimeConfigurable.java	7 Jul 2003 08:20:52 -0000	1.39
  @@ -63,8 +63,8 @@
   import java.util.List;
   import java.util.Locale;
   import java.util.Map;
  -import java.util.NoSuchElementException;
   
  +import org.apache.tools.ant.util.CollectionUtils;
   import org.xml.sax.AttributeList;
   import org.xml.sax.helpers.AttributeListImpl;
   
  @@ -236,17 +236,7 @@
           if (children != null) {
               return Collections.enumeration(children);
           } else {
  -            return new EmptyEnumeration();
  -        }
  -    }
  -
  -    static final class EmptyEnumeration implements Enumeration {
  -        public EmptyEnumeration() {}
  -        public boolean hasMoreElements() {
  -            return false;
  -        }
  -        public Object nextElement() throws NoSuchElementException {
  -            throw new NoSuchElementException();
  +            return new CollectionUtils.EmptyEnumeration();
           }
       }
   
  
  
  
  1.39      +3 -1      ant/src/main/org/apache/tools/ant/Target.java
  
  Index: Target.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Target.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- Target.java	6 Jul 2003 09:57:34 -0000	1.38
  +++ Target.java	7 Jul 2003 08:20:52 -0000	1.39
  @@ -61,6 +61,8 @@
   import java.util.List;
   import java.util.StringTokenizer;
   
  +import org.apache.tools.ant.util.CollectionUtils;
  +
   /**
    * Class to implement a target object with required parameters.
    *
  @@ -222,7 +224,7 @@
           if (dependencies != null) {
               return Collections.enumeration(dependencies);
           } else {
  -            return new RuntimeConfigurable.EmptyEnumeration();
  +            return new CollectionUtils.EmptyEnumeration();
           }
       }
   
  
  
  
  1.7       +16 -1     ant/src/main/org/apache/tools/ant/util/CollectionUtils.java
  
  Index: CollectionUtils.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/CollectionUtils.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CollectionUtils.java	7 Mar 2003 11:23:08 -0000	1.6
  +++ CollectionUtils.java	7 Jul 2003 08:20:52 -0000	1.7
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -55,6 +55,7 @@
   
   import java.util.Dictionary;
   import java.util.Enumeration;
  +import java.util.NoSuchElementException;
   import java.util.Vector;
   
   /**
  @@ -146,4 +147,18 @@
               m1.put(key, m2.get(key));
           }
       }
  +
  +    /**
  +     * @since Ant 1.6
  +     */
  +    public static final class EmptyEnumeration implements Enumeration {
  +        public EmptyEnumeration() {}
  +        public boolean hasMoreElements() {
  +            return false;
  +        }
  +        public Object nextElement() throws NoSuchElementException {
  +            throw new NoSuchElementException();
  +        }
  +    }
  +
   }
  
  
  

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


Mime
View raw message