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 Definer.java
Date Fri, 28 May 2004 15:24:32 GMT
peterreilly    2004/05/28 08:24:32

  Modified:    src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH
                        Definer.java
  Log:
  sync
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.44.2.9  +12 -9     ant/src/main/org/apache/tools/ant/taskdefs/Definer.java
  
  Index: Definer.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Definer.java,v
  retrieving revision 1.44.2.8
  retrieving revision 1.44.2.9
  diff -u -r1.44.2.8 -r1.44.2.9
  --- Definer.java	28 May 2004 08:21:04 -0000	1.44.2.8
  +++ Definer.java	28 May 2004 15:24:32 -0000	1.44.2.9
  @@ -21,9 +21,9 @@
   import java.io.IOException;
   import java.io.InputStream;
   import java.net.URL;
  -import java.util.ArrayList;
  +import java.util.Map;
  +import java.util.HashMap;
   import java.util.Enumeration;
  -import java.util.List;
   import java.util.Locale;
   import java.util.NoSuchElementException;
   import java.util.Properties;
  @@ -45,10 +45,10 @@
   public abstract class Definer extends DefBase {
       private static class ResourceStack extends ThreadLocal {
           public Object initialValue() {
  -            return new ArrayList();
  +            return new HashMap();
           }
  -        List getStack() {
  -            return (List) get();
  +        Map getStack() {
  +            return (Map) get();
           }
       }
       private static ResourceStack resourceStack = new ResourceStack();
  @@ -223,13 +223,16 @@
                       loadProperties(al, url);
                       break;
                   } else {
  -                    if (resourceStack.getStack().contains(url)) {
  -                        log("Warning: Attempting to recursively load " + url
  -                            + " at " + getLocation(),
  +                    if (resourceStack.getStack().get(url) != null) {
  +                        log("Warning: Recursive loading of " + url
  +                            + " ignored"
  +                            + " at " + getLocation()
  +                            + " originally loaded at "
  +                            + resourceStack.getStack().get(url),
                               Project.MSG_WARN);
                       } else {
                           try {
  -                            resourceStack.getStack().add(url);
  +                            resourceStack.getStack().put(url, getLocation());
                               loadAntlib(al, url);
                           } finally {
                               resourceStack.getStack().remove(url);
  
  
  

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


Mime
View raw message