Browse Source

change message of recursive loading of antlibs to include

the original location from where it was loaded.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276494 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
e7cca3123e
1 changed files with 12 additions and 9 deletions
  1. +12
    -9
      src/main/org/apache/tools/ant/taskdefs/Definer.java

+ 12
- 9
src/main/org/apache/tools/ant/taskdefs/Definer.java View File

@@ -21,9 +21,9 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import java.util.Properties; import java.util.Properties;
@@ -45,10 +45,10 @@ import org.apache.tools.ant.types.EnumeratedAttribute;
public abstract class Definer extends DefBase { public abstract class Definer extends DefBase {
private static class ResourceStack extends ThreadLocal { private static class ResourceStack extends ThreadLocal {
public Object initialValue() { 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(); private static ResourceStack resourceStack = new ResourceStack();
@@ -223,13 +223,16 @@ public abstract class Definer extends DefBase {
loadProperties(al, url); loadProperties(al, url);
break; break;
} else { } 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); Project.MSG_WARN);
} else { } else {
try { try {
resourceStack.getStack().add(url);
resourceStack.getStack().put(url, getLocation());
loadAntlib(al, url); loadAntlib(al, url);
} finally { } finally {
resourceStack.getStack().remove(url); resourceStack.getStack().remove(url);


Loading…
Cancel
Save