ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgl...@apache.org
Subject svn commit: r940531 [4/7] - in /ant/core/branches/run-single-test-method: ./ docs/ docs/antlibs/ docs/manual/ docs/manual/CoreTasks/ docs/manual/CoreTypes/ docs/manual/OptionalTasks/ docs/webtest/gettest/ lib/ src/etc/ src/etc/poms/ src/etc/poms/ant-an...
Date Mon, 03 May 2010 17:44:28 GMT
Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/helper/ProjectHelper2.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/helper/ProjectHelper2.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/helper/ProjectHelper2.java Mon May  3 17:44:21 2010
@@ -177,6 +177,28 @@ public class ProjectHelper2 extends Proj
             parse(project, source, new RootHandler(context, mainHandler));
             // Execute the top-level target
             context.getImplicitTarget().execute();
+
+            // resolve extensionOf attributes
+            for (Iterator i = getExtensionStack().iterator(); i.hasNext(); ) {
+                String[] extensionInfo = (String[]) i.next();
+                String tgName = extensionInfo[0];
+                String name = extensionInfo[1];
+                Hashtable projectTargets = project.getTargets();
+                if (!projectTargets.containsKey(tgName)) {
+                    throw new BuildException("can't add target "
+                                             + name + " to extension-point "
+                                             + tgName
+                                             + " because the extension-point"
+                                             + " is unknown.");
+                }
+                Target t = (Target) projectTargets.get(tgName);
+                if (!(t instanceof ExtensionPoint)) {
+                    throw new BuildException("referenced target "
+                                             + tgName
+                                             + " is not an extension-point");
+                }
+                t.addDependency(name);
+            }
         }
     }
 
@@ -760,17 +782,34 @@ public class ProjectHelper2 extends Proj
             String antFileProp =
                 MagicNames.ANT_FILE + "." + context.getCurrentProjectName();
             String dup = project.getProperty(antFileProp);
+            String typeProp =
+                MagicNames.ANT_FILE_TYPE + "." + context.getCurrentProjectName();
+            String dupType = project.getProperty(typeProp);
             if (dup != null && nameAttributeSet) {
-                File dupFile = new File(dup);
-                if (context.isIgnoringProjectTag() && !dupFile.equals(context.getBuildFile())) {
+                Object dupFile = null;
+                Object contextFile = null;
+                if (MagicNames.ANT_FILE_TYPE_URL.equals(dupType)) {
+                    try {
+                        dupFile = new URL(dup);
+                    } catch (java.net.MalformedURLException mue) {
+                        throw new BuildException("failed to parse "
+                                                 + dup + " as URL while looking"
+                                                 + " at a duplicate project"
+                                                 + " name.", mue);
+                    }
+                    contextFile = context.getBuildFileURL();
+                } else {
+                    dupFile = new File(dup);
+                    contextFile = context.getBuildFile();
+                }
+
+                if (context.isIgnoringProjectTag() && !dupFile.equals(contextFile)) {
                     project.log("Duplicated project name in import. Project "
                             + context.getCurrentProjectName() + " defined first in " + dup
-                            + " and again in " + context.getBuildFile(), Project.MSG_WARN);
+                            + " and again in " + contextFile, Project.MSG_WARN);
                 }
             }
             if (nameAttributeSet) {
-                String typeProp = MagicNames.ANT_FILE_TYPE + "."
-                    + context.getCurrentProjectName();
                 if (context.getBuildFile() != null) {
                     project.setUserProperty(antFileProp,
                                             context.getBuildFile().toString());
@@ -921,7 +960,7 @@ public class ProjectHelper2 extends Proj
                 prefix = getTargetPrefix(context);
                 if (prefix == null) {
                     throw new BuildException("can't include build file "
-                                             + context.getBuildFile()
+                                             + context.getBuildFileURL()
                                              + ", no as attribute has been given"
                                              + " and the project tag doesn't"
                                              + " specify a name attribute");
@@ -970,6 +1009,9 @@ public class ProjectHelper2 extends Proj
                 project.addOrReplaceTarget(newName, newTarget);
             }
             if (extensionPoint != null) {
+                ProjectHelper helper =
+                    (ProjectHelper) context.getProject().
+                        getReference(ProjectHelper.PROJECTHELPER_REFERENCE);
                 for (Iterator iter =
                          Target.parseDepends(extensionPoint, name, "extensionOf")
                          .iterator();
@@ -978,20 +1020,12 @@ public class ProjectHelper2 extends Proj
                     if (isInIncludeMode()) {
                         tgName = prefix + sep + tgName;
                     }
-                    if (!projectTargets.containsKey(tgName)) {
-                        throw new BuildException("can't add target "
-                                                 + name + " to extension-point "
-                                                 + tgName
-                                                 + " because the extension-point"
-                                                 + " is unknown.");
-                    }
-                    Target t = (Target) projectTargets.get(tgName);
-                    if (!(t instanceof ExtensionPoint)) {
-                        throw new BuildException("referenced target "
-                                                 + tgName
-                                                 + " is not an extension-point");
-                    }
-                    t.addDependency(name);
+
+                    // defer extensionpoint resolution until the full
+                    // import stack has been processed
+                    helper.getExtensionStack().add(new String[] {
+                            tgName, name
+                        });
                 }
             }
         }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java Mon May  3 17:44:21 2010
@@ -859,7 +859,7 @@ public class ProjectHelperImpl extends P
             IntrospectionHelper ih = IntrospectionHelper.getHelper(helperImpl.project, parentClass);
 
             try {
-                String elementName = propType.toLowerCase(Locale.US);
+                String elementName = propType.toLowerCase(Locale.ENGLISH);
                 if (parent instanceof UnknownElement) {
                     UnknownElement uc = new UnknownElement(elementName);
                     uc.setProject(helperImpl.project);

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/input/InputRequest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/input/InputRequest.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/input/InputRequest.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/input/InputRequest.java Mon May  3 17:44:21 2010
@@ -24,7 +24,7 @@ package org.apache.tools.ant.input;
  * @since Ant 1.5
  */
 public class InputRequest {
-    private String prompt;
+    private final String prompt;
     private String input;
     private String defaultValue;
 

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/input/MultipleChoiceInputRequest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/input/MultipleChoiceInputRequest.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/input/MultipleChoiceInputRequest.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/input/MultipleChoiceInputRequest.java Mon May  3 17:44:21 2010
@@ -18,6 +18,7 @@
 
 package org.apache.tools.ant.input;
 
+import java.util.LinkedHashSet;
 import java.util.Vector;
 
 /**
@@ -26,7 +27,7 @@ import java.util.Vector;
  * @since Ant 1.5
  */
 public class MultipleChoiceInputRequest extends InputRequest {
-    private Vector choices = new Vector();
+    private final LinkedHashSet choices;
 
     /**
      * @param prompt The prompt to show to the user.  Must not be null.
@@ -38,14 +39,14 @@ public class MultipleChoiceInputRequest 
         if (choices == null) {
             throw new IllegalArgumentException("choices must not be null");
         }
-        this.choices = choices;
+        this.choices = new LinkedHashSet(choices);
     }
 
     /**
      * @return The possible values.
      */
     public Vector getChoices() {
-        return choices;
+        return new Vector(choices);
     }
 
     /**

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/launch/Locator.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/launch/Locator.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/launch/Locator.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/launch/Locator.java Mon May  3 17:44:21 2010
@@ -18,7 +18,6 @@
 package org.apache.tools.ant.launch;
 
 import java.net.MalformedURLException;
-
 import java.net.URL;
 import java.io.File;
 import java.io.FilenameFilter;
@@ -442,7 +441,7 @@ public final class Locator {
             // Found in java.home as given
             return toolsJar;
         }
-        if (javaHome.toLowerCase(Locale.US).endsWith(File.separator + "jre")) {
+        if (javaHome.toLowerCase(Locale.ENGLISH).endsWith(File.separator + "jre")) {
             javaHome = javaHome.substring(
                 0, javaHome.length() - "/jre".length());
             toolsJar = new File(javaHome + libToolsJar);
@@ -498,7 +497,7 @@ public final class Locator {
         if (!location.isDirectory()) {
             urls = new URL[1];
             String path = location.getPath();
-            String littlePath = path.toLowerCase(Locale.US);
+            String littlePath = path.toLowerCase(Locale.ENGLISH);
             for (int i = 0; i < extensions.length; ++i) {
                 if (littlePath.endsWith(extensions[i])) {
                     urls[0] = fileToURL(location);
@@ -510,7 +509,7 @@ public final class Locator {
         File[] matches = location.listFiles(
             new FilenameFilter() {
                 public boolean accept(File dir, String name) {
-                    String littleName = name.toLowerCase(Locale.US);
+                    String littleName = name.toLowerCase(Locale.ENGLISH);
                     for (int i = 0; i < extensions.length; ++i) {
                         if (littleName.endsWith(extensions[i])) {
                             return true;

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/listener/BigProjectLogger.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/listener/BigProjectLogger.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/listener/BigProjectLogger.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/listener/BigProjectLogger.java Mon May  3 17:44:21 2010
@@ -18,7 +18,6 @@
 package org.apache.tools.ant.listener;
 
 import org.apache.tools.ant.BuildEvent;
-import org.apache.tools.ant.NoBannerLogger;
 import org.apache.tools.ant.SubBuildListener;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.util.StringUtils;
@@ -33,7 +32,7 @@ import java.io.File;
  * @since Ant1.7.1
  */
 
-public class BigProjectLogger extends NoBannerLogger
+public class BigProjectLogger extends SimpleBigProjectLogger
     implements SubBuildListener {
 
     private volatile boolean subBuildStartedRaised = false;
@@ -114,22 +113,6 @@ public class BigProjectLogger extends No
         super.messageLogged(event);
     }
 
-    /**
-     * Override point, extract the target name
-     *
-     * @param event the event to work on
-     * @return the target name -including the owning project name (if non-null)
-     */
-    protected String extractTargetName(BuildEvent event) {
-        String targetName = event.getTarget().getName();
-        String projectName = extractProjectName(event);
-        if (projectName != null && targetName != null) {
-            return projectName + '.' + targetName;
-        } else {
-            return targetName;
-        }
-    }
-
 
     /**
      * {@inheritDoc}

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/property/ResolvePropertyMap.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/property/ResolvePropertyMap.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/property/ResolvePropertyMap.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/property/ResolvePropertyMap.java Mon May  3 17:44:21 2010
@@ -35,6 +35,7 @@ public class ResolvePropertyMap implemen
     private final ParseProperties parseProperties;
     private final GetProperty master;
     private Map map;
+    private String prefix;
 
     /**
      * Constructor with a master getproperty and a collection of expanders.
@@ -57,12 +58,19 @@ public class ResolvePropertyMap implemen
             throw new BuildException(
                 "Property " + name + " was circularly " + "defined.");
         }
-        // Note: the master overrides (even if the name is subsequently
-        //       prefixed)
-        Object masterProperty = master.getProperty(name);
+
+        // if the property has already been set to the name it will
+        // have in the end, then return the existing value to ensure
+        // properties remain immutable
+        String masterPropertyName = name;
+        if (prefix != null) {
+            masterPropertyName = prefix + name;
+        }
+        Object masterProperty = master.getProperty(masterPropertyName);
         if (masterProperty != null) {
             return masterProperty;
         }
+
         try {
             seen.add(name);
             return parseProperties.parseProperties((String) map.get(name));
@@ -74,9 +82,21 @@ public class ResolvePropertyMap implemen
     /**
      * The action method - resolves all the properties in a map.
      * @param map the map to resolve properties in.
+     * @deprecated since Ant 1.8.1, use the two-arg method instead.
      */
     public void resolveAllProperties(Map map) {
+        resolveAllProperties(map, null);
+    }
+
+    /**
+     * The action method - resolves all the properties in a map.
+     * @param map the map to resolve properties in.
+     * @param prefix the prefix the properties defined inside the map
+     * will finally receive - may be null.
+     */
+    public void resolveAllProperties(Map map, String prefix) {
         this.map = map; // The map gets used in the getProperty callback
+        this.prefix = prefix;
         for (Iterator i = map.keySet().iterator(); i.hasNext();) {
             String key = (String) i.next();
             Object result = getProperty(key);

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Ant.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Ant.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Ant.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Ant.java Mon May  3 17:44:21 2010
@@ -41,6 +41,7 @@ import org.apache.tools.ant.MagicNames;
 import org.apache.tools.ant.Main;
 import org.apache.tools.ant.types.PropertySet;
 import org.apache.tools.ant.util.FileUtils;
+import org.apache.tools.ant.util.VectorSet;
 
 /**
  * Build a sub-project.
@@ -333,7 +334,7 @@ public class Ant extends Task {
     public void execute() throws BuildException {
         File savedDir = dir;
         String savedAntFile = antFile;
-        Vector locals = new Vector(targets);
+        Vector locals = new VectorSet(targets);
         try {
             getNewProject();
 

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/AntStructure.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/AntStructure.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/AntStructure.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/AntStructure.java Mon May  3 17:44:21 2010
@@ -27,6 +27,7 @@ import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
 import java.util.Enumeration;
 import java.util.Hashtable;
+import java.util.Iterator;
 import java.util.Vector;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.IntrospectionHelper;
@@ -95,22 +96,24 @@ public class AntStructure extends Task {
             }
 
             printer.printHead(out, getProject(),
-                              getProject().getTaskDefinitions(),
-                              getProject().getDataTypeDefinitions());
+                              new Hashtable(getProject().getTaskDefinitions()),
+                              new Hashtable(getProject().getDataTypeDefinitions()));
 
             printer.printTargetDecl(out);
 
-            Enumeration dataTypes = getProject().getDataTypeDefinitions().keys();
-            while (dataTypes.hasMoreElements()) {
-                String typeName = (String) dataTypes.nextElement();
+            Iterator dataTypes = getProject().getCopyOfDataTypeDefinitions()
+                .keySet().iterator();
+            while (dataTypes.hasNext()) {
+                String typeName = (String) dataTypes.next();
                 printer.printElementDecl(
                     out, getProject(), typeName,
                     (Class) getProject().getDataTypeDefinitions().get(typeName));
             }
 
-            Enumeration tasks = getProject().getTaskDefinitions().keys();
-            while (tasks.hasMoreElements()) {
-                String tName = (String) tasks.nextElement();
+            Iterator tasks = getProject().getCopyOfTaskDefinitions().keySet()
+                .iterator();
+            while (tasks.hasNext()) {
+                String tName = (String) tasks.next();
                 printer.printElementDecl(out, getProject(), tName,
                                          (Class) getProject().getTaskDefinitions().get(tName));
             }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Concat.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Concat.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Concat.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Concat.java Mon May  3 17:44:21 2010
@@ -465,7 +465,7 @@ public class Concat extends Task impleme
      * Stores a collection of file sets and/or file lists, used to
      * select multiple files for concatenation.
      */
-    private ResourceCollection rc;
+    private Resources rc;
 
     /** for filtering the concatenated */
     private Vector filterChains;
@@ -634,19 +634,15 @@ public class Concat extends Task impleme
      * @param c the ResourceCollection to add.
      * @since Ant 1.7
      */
-    public synchronized void add(ResourceCollection c) {
-        if (rc == null) {
-            rc = c;
-            return;
-        }
-        if (!(rc instanceof Resources)) {
-            Resources newRc = new Resources();
-            newRc.setProject(getProject());
-            newRc.setCache(true);
-            newRc.add(rc);
-            rc = newRc;
+    public void add(ResourceCollection c) {
+        synchronized (this) {
+            if (rc == null) {
+                rc = new Resources();
+                rc.setProject(getProject());
+                rc.setCache(true);
+            }
         }
-        ((Resources) rc).add(c);
+        rc.add(c);
     }
 
     /**

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Copy.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Copy.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Copy.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Copy.java Mon May  3 17:44:21 2010
@@ -66,6 +66,9 @@ import org.apache.tools.ant.util.FlatFil
  * @ant.task category="filesystem"
  */
 public class Copy extends Task {
+    private static final String MSG_WHEN_COPYING_EMPTY_RC_TO_FILE =
+        "Cannot perform operation from directory to file.";
+
     static final File NULL_FILE_PLACEHOLDER = new File("/NULL_FILE");
     static final String LINE_SEPARATOR = System.getProperty("line.separator");
     // CheckStyle:VisibilityModifier OFF - bc
@@ -395,10 +398,22 @@ public class Copy extends Task {
             // will be removed in validateAttributes
             savedRc = (ResourceCollection) rcs.elementAt(0);
         }
-        // make sure we don't have an illegal set of options
-        validateAttributes();
 
         try {
+            // make sure we don't have an illegal set of options
+            try {
+                validateAttributes();
+            } catch (BuildException e) {
+                if (failonerror
+                    || !getMessage(e)
+                    .equals(MSG_WHEN_COPYING_EMPTY_RC_TO_FILE)) {
+                    throw e;
+                } else {
+                    log("Warning: " + getMessage(e), Project.MSG_ERR);
+                    return;
+                }
+            }
+
             // deal with the single file
             copySingleFile();
 
@@ -631,8 +646,7 @@ public class Copy extends Task {
                                              + " files.");
                 }
                 if (rc.size() == 0) {
-                    throw new BuildException(
-                        "Cannot perform operation from directory to file.");
+                    throw new BuildException(MSG_WHEN_COPYING_EMPTY_RC_TO_FILE);
                 } else if (rc.size() == 1) {
                     Resource res = (Resource) rc.iterator().next();
                     FileProvider r = (FileProvider) res.as(FileProvider.class);

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Definer.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Definer.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Definer.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Definer.java Mon May  3 17:44:21 2010
@@ -271,7 +271,7 @@ public abstract class Definer extends De
                 URL url = (URL) urls.nextElement();
 
                 int fmt = this.format;
-                if (url.toString().toLowerCase(Locale.US).endsWith(".xml")) {
+                if (url.toString().toLowerCase(Locale.ENGLISH).endsWith(".xml")) {
                     fmt = Format.XML;
                 }
 

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Ear.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Ear.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Ear.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Ear.java Mon May  3 17:44:21 2010
@@ -19,7 +19,6 @@ package org.apache.tools.ant.taskdefs;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.Locale;
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
@@ -125,9 +124,8 @@ public class Ear extends Jar {
         // attribute - or if it's being added twice, meaning the same
         // file is specified by the "appxml" attribute and in a
         // <fileset> element.
-        String vPathLowerCase = vPath.toLowerCase(Locale.ENGLISH);
-        if (XML_DESCRIPTOR_PATH.equals(vPathLowerCase))  {
-            if (deploymentDescriptor != null
+        if (XML_DESCRIPTOR_PATH.equalsIgnoreCase(vPath))  {
+            if (deploymentDescriptor == null
                 || !FILE_UTILS.fileNameEquals(deploymentDescriptor, file)
                 || descriptorAdded) {
                 logWhenWriting("Warning: selected " + archiveType

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Exec.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Exec.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Exec.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Exec.java Mon May  3 17:44:21 2010
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
+import java.util.Locale;
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.MagicNames;
@@ -97,9 +98,9 @@ public class Exec extends Task {
           dir = getProject().getBaseDir();
         }
 
-        if (myos.toLowerCase().indexOf("windows") >= 0) {
+        if (myos.toLowerCase(Locale.ENGLISH).indexOf("windows") >= 0) {
             if (!dir.equals(getProject().resolveFile("."))) {
-                if (myos.toLowerCase().indexOf("nt") >= 0) {
+                if (myos.toLowerCase(Locale.ENGLISH).indexOf("nt") >= 0) {
                     command = "cmd /c cd " + dir + " && " + command;
                 } else {
                     String ant = getProject().getProperty(MagicNames.ANT_HOME);

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ExecTask.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ExecTask.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ExecTask.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ExecTask.java Mon May  3 17:44:21 2010
@@ -401,7 +401,7 @@ public class ExecTask extends Task {
      * @param osFamily the family to restrict to.
      */
     public void setOsFamily(String osFamily) {
-        this.osFamily = osFamily.toLowerCase(Locale.US);
+        this.osFamily = osFamily.toLowerCase(Locale.ENGLISH);
     }
 
     /**

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java Mon May  3 17:44:21 2010
@@ -20,7 +20,7 @@ package org.apache.tools.ant.taskdefs;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.Hashtable;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Vector;
 import org.apache.tools.ant.BuildException;
@@ -527,7 +527,7 @@ public class ExecuteOn extends ExecTask 
         final char fileSeparator = File.separatorChar;
         Vector targets = new Vector();
         if (targetFilePos != null) {
-            Hashtable addedFiles = new Hashtable();
+            HashSet addedFiles = new HashSet();
             for (int i = 0; i < srcFiles.length; i++) {
                 String[] subTargets = mapper.mapFileName(srcFiles[i]);
                 if (subTargets != null) {
@@ -543,7 +543,7 @@ public class ExecuteOn extends ExecTask 
                         }
                         if (!addedFiles.contains(name)) {
                             targets.addElement(name);
-                            addedFiles.put(name, name);
+                            addedFiles.add(name);
                         }
                     }
                 }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Get.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Get.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Get.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Get.java Mon May  3 17:44:21 2010
@@ -658,7 +658,12 @@ public class Get extends Task {
                         .setUseCaches(httpUseCaches);
             }
             // connect to the remote site (may take some time)
-            connection.connect();
+            try {
+                connection.connect();
+            } catch (NullPointerException e) {
+                //bad URLs can trigger NPEs in some JVMs
+                throw new BuildException("Failed to parse " + source.toString(), e);
+            }
 
             // First check on a 301 / 302 (moved) response (HTTP only)
             if (connection instanceof HttpURLConnection) {
@@ -673,7 +678,7 @@ public class Get extends Task {
                             + (responseCode == HttpURLConnection.HTTP_MOVED_PERM ? " permanently"
                                     : "") + " moved to " + newLocation;
                     log(message, logLevel);
-                    URL newURL = new URL(newLocation);
+                    URL newURL = new URL(aSource, newLocation);
                     if (!redirectionAllowed(aSource, newURL))
                     {
                         return null;

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Jar.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Jar.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Jar.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Jar.java Mon May  3 17:44:21 2010
@@ -249,7 +249,8 @@ public class Jar extends Zip {
      * jars on Java 1.4 or earlier Ant will not include META-INF
      * unless explicitly asked to.</p>
      *
-     * @see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4408526
+     * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4408526">
+     * jar -i omits service providers in index.list</a>
      * @since Ant 1.8.0
      * @param flag a <code>boolean</code> value, defaults to false
      */
@@ -812,7 +813,15 @@ public class Jar extends Zip {
             // manifest this means we claim an update was needed and
             // only include the manifests, skipping any uptodate
             // checks here defering them for the second run
-            return new ArchiveState(true, grabManifests(rcs));
+            Resource[][] manifests = grabManifests(rcs);
+            int count = 0;
+            for (int i = 0; i < manifests.length; i++) {
+                count += manifests[i].length;
+            }
+            log("found a total of " + count + " manifests in "
+                + manifests.length + " resource collections",
+                Project.MSG_VERBOSE);
+            return new ArchiveState(true, manifests);
         }
 
         // need to handle manifest as a special check
@@ -1166,7 +1175,8 @@ public class Jar extends Zip {
                     });
             }
             for (int j = 0; j < resources[0].length; j++) {
-                if (resources[0][j].getName().equalsIgnoreCase(MANIFEST_NAME)) {
+                String name = resources[0][j].getName().replace('\\', '/');
+                if (name.equalsIgnoreCase(MANIFEST_NAME)) {
                     manifests[i] = new Resource[] {resources[0][j]};
                     break;
                 }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Javac.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Javac.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Javac.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Javac.java Mon May  3 17:44:21 2010
@@ -679,7 +679,7 @@ public class Javac extends MatchingTask 
      * @return true if this is a forked invocation
      */
     public boolean isForkedJavac() {
-        return fork || "extJavac".equals(getCompiler());
+        return fork || EXTJAVAC.equalsIgnoreCase(getCompiler());
     }
 
     /**
@@ -777,7 +777,7 @@ public class Javac extends MatchingTask 
                 return nextSelected;
             }
         }
-        if (CLASSIC.equals(anImplementation)) {
+        if (CLASSIC.equalsIgnoreCase(anImplementation)) {
             return assumedJavaVersion();
         }
         if (EXTJAVAC.equalsIgnoreCase(anImplementation)) {
@@ -1007,7 +1007,7 @@ public class Javac extends MatchingTask 
         String compilerImpl = getCompilerVersion();
         if (fork) {
             if (isJdkCompiler(compilerImpl)) {
-                compilerImpl = "extJavac";
+                compilerImpl = EXTJAVAC;
             } else {
                 log("Since compiler setting isn't classic or modern, "
                     + "ignoring fork setting.", Project.MSG_WARN);

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Javadoc.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Javadoc.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Javadoc.java Mon May  3 17:44:21 2010
@@ -28,6 +28,7 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Locale;
 import java.util.StringTokenizer;
@@ -1342,7 +1343,7 @@ public class Javadoc extends Task {
          * specified.
          */
         public void setScope (String verboseScope) throws BuildException {
-            verboseScope = verboseScope.toLowerCase(Locale.US);
+            verboseScope = verboseScope.toLowerCase(Locale.ENGLISH);
 
             boolean[] elements = new boolean[SCOPE_ELEMENTS.length];
 
@@ -2320,7 +2321,7 @@ public class Javadoc extends Task {
      * @since 1.5
      */
     private void parsePackages(Vector pn, Path sp) {
-        Vector addedPackages = new Vector();
+        HashSet addedPackages = new HashSet();
         Vector dirSets = (Vector) packageSets.clone();
 
         // for each sourcePath entry, add a directoryset with includes
@@ -2403,7 +2404,7 @@ public class Javadoc extends Task {
                         String packageName =
                             dirs[i].replace(File.separatorChar, '.');
                         if (!addedPackages.contains(packageName)) {
-                            addedPackages.addElement(packageName);
+                            addedPackages.add(packageName);
                             pn.addElement(packageName);
                         }
                     }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Jikes.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Jikes.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Jikes.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Jikes.java Mon May  3 17:44:21 2010
@@ -21,6 +21,7 @@ import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.util.Locale;
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
@@ -81,7 +82,7 @@ public class Jikes {
             // Windows has a 32k limit on total arg size, so
             // create a temporary file to store all the arguments
 
-            if (myos.toLowerCase().indexOf("windows") >= 0
+            if (myos.toLowerCase(Locale.ENGLISH).indexOf("windows") >= 0
                 && args.length > MAX_FILES_ON_COMMAND_LINE) {
                 BufferedWriter out = null;
                 try {

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Length.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Length.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Length.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Length.java Mon May  3 17:44:21 2010
@@ -68,6 +68,14 @@ public class Length extends Task impleme
     }
 
     /**
+     * Set the single resource for this task.
+     * @param resource the Resource whose length to retrieve.
+     */
+    public synchronized void setResource(Resource resource) {
+        add(resource);
+    }
+
+    /**
      * Set the single file for this task.
      * @param file the <code>File</code> whose length to retrieve.
      */

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java Mon May  3 17:44:21 2010
@@ -37,6 +37,7 @@ import org.apache.tools.ant.types.Filter
 import org.apache.tools.ant.types.resources.FileResource;
 import org.apache.tools.ant.types.resources.JavaResource;
 import org.apache.tools.ant.util.FileUtils;
+import org.apache.tools.ant.util.ResourceUtils;
 
 /**
  * Load a file's contents as Ant properties.
@@ -60,6 +61,11 @@ public class LoadProperties extends Task
      * Encoding to use for input; defaults to the platform's default encoding.
      */
     private String encoding = null;
+    
+    /**
+     * Prefix for loaded properties.
+     */
+    private String prefix = null;
 
     /**
      * Set the file to load.
@@ -128,6 +134,14 @@ public class LoadProperties extends Task
     }
 
     /**
+     * Set the prefix to load these properties under.
+     * @param prefix to set
+     */
+    public void setPrefix(String prefix) {
+        this.prefix = prefix;
+    }
+
+    /**
      * load Ant properties from the source file or resource
      *
      * @exception BuildException if something goes wrong with the build
@@ -168,12 +182,13 @@ public class LoadProperties extends Task
                 if (!text.endsWith("\n")) {
                     text = text + "\n";
                 }
-                tis = new ByteArrayInputStream(text.getBytes("ISO8859_1"));
+                tis = new ByteArrayInputStream(text.getBytes(ResourceUtils.ISO_8859_1));
                 final Properties props = new Properties();
                 props.load(tis);
 
                 Property propertyTask = new Property();
                 propertyTask.bindToOwner(this);
+                propertyTask.setPrefix(prefix);
                 propertyTask.addProperties(props);
             }
         } catch (final IOException ioe) {

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/MacroDef.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/MacroDef.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/MacroDef.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/MacroDef.java Mon May  3 17:44:21 2010
@@ -339,7 +339,7 @@ public class MacroDef extends AntlibDefi
                 throw new BuildException(
                     "Illegal name [" + name + "] for attribute");
             }
-            this.name = name.toLowerCase(Locale.US);
+            this.name = name.toLowerCase(Locale.ENGLISH);
         }
 
         /**
@@ -443,7 +443,7 @@ public class MacroDef extends AntlibDefi
                 throw new BuildException(
                     "Illegal name [" + name + "] for attribute");
             }
-            this.name = name.toLowerCase(Locale.US);
+            this.name = name.toLowerCase(Locale.ENGLISH);
         }
 
         /**
@@ -567,7 +567,7 @@ public class MacroDef extends AntlibDefi
                 throw new BuildException(
                     "Illegal name [" + name + "] for macro element");
             }
-            this.name = name.toLowerCase(Locale.US);
+            this.name = name.toLowerCase(Locale.ENGLISH);
         }
 
         /**

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java Mon May  3 17:44:21 2010
@@ -127,7 +127,7 @@ public class MacroInstance extends Task 
         for (Iterator i = unknownElements.iterator(); i.hasNext();) {
             UnknownElement ue = (UnknownElement) i.next();
             String name = ProjectHelper.extractNameFromComponentName(
-                ue.getTag()).toLowerCase(Locale.US);
+                ue.getTag()).toLowerCase(Locale.ENGLISH);
             if (getNsElements().get(name) == null) {
                 throw new BuildException("unsupported element " + name);
             }
@@ -199,7 +199,7 @@ public class MacroInstance extends Task 
                 case STATE_EXPECT_NAME:
                     if (ch == '}') {
                         state = STATE_NORMAL;
-                        String name = macroName.toString().toLowerCase(Locale.US);
+                        String name = macroName.toString().toLowerCase(Locale.ENGLISH);
                         String value = (String) macroMapping.get(name);
                         if (value == null) {
                             ret.append("@{");
@@ -278,7 +278,7 @@ public class MacroInstance extends Task 
             UnknownElement unknownElement = (UnknownElement) r.getProxy();
             String tag = unknownElement.getTaskType();
             if (tag != null) {
-                tag = tag.toLowerCase(Locale.US);
+                tag = tag.toLowerCase(Locale.ENGLISH);
             }
             MacroDef.TemplateElement templateElement =
                 (MacroDef.TemplateElement) getNsElements().get(tag);

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Manifest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Manifest.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Manifest.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Manifest.java Mon May  3 17:44:21 2010
@@ -27,9 +27,13 @@ import java.io.Reader;
 import java.io.StringWriter;
 import java.io.UnsupportedEncodingException;
 import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Locale;
+import java.util.Map;
 import java.util.Vector;
 import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.util.CollectionUtils;
 import org.apache.tools.ant.util.FileUtils;
 
 /**
@@ -87,6 +91,15 @@ public class Manifest {
     /** Encoding to be used for JAR files. */
     public static final String JAR_ENCODING = "UTF-8";
 
+    private static final String ATTRIBUTE_MANIFEST_VERSION_LC =
+        ATTRIBUTE_MANIFEST_VERSION.toLowerCase(Locale.ENGLISH);
+    private static final String ATTRIBUTE_NAME_LC =
+        ATTRIBUTE_NAME.toLowerCase(Locale.ENGLISH);
+    private static final String ATTRIBUTE_FROM_LC =
+        ATTRIBUTE_FROM.toLowerCase(Locale.ENGLISH);
+    private static final String ATTRIBUTE_CLASSPATH_LC =
+        ATTRIBUTE_CLASSPATH.toLowerCase(Locale.ENGLISH);
+
     /**
      * An attribute for the manifest.
      * Those attributes that are not nested into a section will be added to the "Main" section.
@@ -235,7 +248,7 @@ public class Manifest {
             if (name == null) {
                 return null;
             }
-            return name.toLowerCase();
+            return name.toLowerCase(Locale.ENGLISH);
         }
 
         /**
@@ -398,10 +411,7 @@ public class Manifest {
         private String name = null;
 
         /** The section's attributes.*/
-        private Hashtable attributes = new Hashtable();
-
-        /** Index used to retain the attribute ordering */
-        private Vector attributeIndex = new Vector();
+        private Map attributes = new LinkedHashMap();
 
         /**
          * The name of the section; optional -default is the main section.
@@ -491,8 +501,10 @@ public class Manifest {
         public void merge(Section section, boolean mergeClassPaths)
             throws ManifestException {
             if (name == null && section.getName() != null
-                || name != null
-                && !(name.equalsIgnoreCase(section.getName()))) {
+                || (name != null && section.getName() != null
+                    && !(name.toLowerCase(Locale.ENGLISH)
+                         .equals(section.getName().toLowerCase(Locale.ENGLISH))))
+                ) {
                 throw new ManifestException("Unable to merge sections "
                     + "with different names");
             }
@@ -586,7 +598,7 @@ public class Manifest {
          *         instances.
          */
         public Attribute getAttribute(String attributeName) {
-            return (Attribute) attributes.get(attributeName.toLowerCase());
+            return (Attribute) attributes.get(attributeName.toLowerCase(Locale.ENGLISH));
         }
 
         /**
@@ -596,7 +608,7 @@ public class Manifest {
          *         key of an attribute of the section.
          */
         public Enumeration getAttributeKeys() {
-            return attributeIndex.elements();
+            return CollectionUtils.asEnumeration(attributes.keySet().iterator());
         }
 
         /**
@@ -608,7 +620,7 @@ public class Manifest {
          *         in the section
          */
         public String getAttributeValue(String attributeName) {
-            Attribute attribute = getAttribute(attributeName.toLowerCase());
+            Attribute attribute = getAttribute(attributeName.toLowerCase(Locale.ENGLISH));
             if (attribute == null) {
                 return null;
             }
@@ -621,9 +633,8 @@ public class Manifest {
          * @param attributeName the name of the attribute to be removed.
          */
         public void removeAttribute(String attributeName) {
-            String key = attributeName.toLowerCase();
+            String key = attributeName.toLowerCase(Locale.ENGLISH);
             attributes.remove(key);
-            attributeIndex.removeElement(key);
         }
 
         /**
@@ -659,7 +670,8 @@ public class Manifest {
             if (attribute.getName() == null || attribute.getValue() == null) {
                 throw new BuildException("Attributes must have name and value");
             }
-            if (attribute.getKey().equalsIgnoreCase(ATTRIBUTE_NAME)) {
+            String attributeKey = attribute.getKey();
+            if (attributeKey.equals(ATTRIBUTE_NAME_LC)) {
                 warnings.addElement("\"" + ATTRIBUTE_NAME + "\" attributes "
                     + "should not occur in the main section and must be the "
                     + "first element in all other sections: \""
@@ -667,13 +679,12 @@ public class Manifest {
                 return attribute.getValue();
             }
 
-            if (attribute.getKey().startsWith(ATTRIBUTE_FROM.toLowerCase())) {
+            if (attributeKey.startsWith(ATTRIBUTE_FROM_LC)) {
                 warnings.addElement(ERROR_FROM_FORBIDDEN
                     + attribute.getName() + ": " + attribute.getValue() + "\"");
             } else {
                 // classpath attributes go into a vector
-                String attributeKey = attribute.getKey();
-                if (attributeKey.equalsIgnoreCase(ATTRIBUTE_CLASSPATH)) {
+                if (attributeKey.equals(ATTRIBUTE_CLASSPATH_LC)) {
                     Attribute classpathAttribute =
                         (Attribute) attributes.get(attributeKey);
 
@@ -731,9 +742,6 @@ public class Manifest {
             }
             String attributeKey = attribute.getKey();
             attributes.put(attributeKey, attribute);
-            if (!attributeIndex.contains(attributeKey)) {
-                attributeIndex.addElement(attributeKey);
-            }
         }
 
         /**
@@ -781,10 +789,7 @@ public class Manifest {
     private Section mainSection = new Section();
 
     /** The named sections of this manifest */
-    private Hashtable sections = new Hashtable();
-
-    /** Index of sections - used to retain order of sections in manifest */
-    private Vector sectionIndex = new Vector();
+    private Map sections = new LinkedHashMap();
 
     /**
      * Construct a manifest from Ant's default manifest file.
@@ -898,9 +903,6 @@ public class Manifest {
             throw new BuildException("Sections must have a name");
         }
         sections.put(sectionName, section);
-        if (!sectionIndex.contains(sectionName)) {
-            sectionIndex.addElement(sectionName);
-        }
     }
 
     /**
@@ -915,7 +917,7 @@ public class Manifest {
         if (attribute.getKey() == null || attribute.getValue() == null) {
             throw new BuildException("Attributes must have name and value");
         }
-        if (attribute.getKey().equalsIgnoreCase(ATTRIBUTE_MANIFEST_VERSION)) {
+        if (attribute.getKey().equals(ATTRIBUTE_MANIFEST_VERSION_LC)) {
             manifestVersion = attribute.getValue();
         } else {
             mainSection.addConfiguredAttribute(attribute);
@@ -1041,9 +1043,9 @@ public class Manifest {
             }
         }
 
-        Enumeration e = sectionIndex.elements();
-        while (e.hasMoreElements()) {
-            String sectionName = (String) e.nextElement();
+        Iterator e = sections.keySet().iterator();
+        while (e.hasNext()) {
+            String sectionName = (String) e.next();
             Section section = getSection(sectionName);
             section.write(writer, flatten);
         }
@@ -1079,9 +1081,9 @@ public class Manifest {
         }
 
         // create a vector and add in the warnings for all the sections
-        Enumeration e = sections.elements();
-        while (e.hasMoreElements()) {
-            Section section = (Section) e.nextElement();
+        Iterator e = sections.values().iterator();
+        while (e.hasNext()) {
+            Section section = (Section) e.next();
             Enumeration e2 = section.getWarnings();
             while (e2.hasMoreElements()) {
                 warnings.addElement(e2.nextElement());
@@ -1172,6 +1174,6 @@ public class Manifest {
      * @return an Enumeration of section names
      */
     public Enumeration getSectionNames() {
-        return sectionIndex.elements();
+        return CollectionUtils.asEnumeration(sections.keySet().iterator());
     }
 }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Move.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Move.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Move.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Move.java Mon May  3 17:44:21 2010
@@ -338,6 +338,8 @@ public class Move extends Copy {
             destFile = getFileUtils().normalize(destFile.getAbsolutePath());
             if (destFile.equals(sourceFile)) {
                 //no point in renaming a file to its own canonical version...
+                log("Rename of " + sourceFile + " to " + destFile
+                    + " is a no-op.", Project.MSG_VERBOSE);
                 return true;
             }
             if (!(sourceFile.equals(destFile.getCanonicalFile()) || destFile.delete())) {

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java Mon May  3 17:44:21 2010
@@ -20,8 +20,8 @@ package org.apache.tools.ant.taskdefs;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.HashSet;
+import java.util.Iterator;
 
 /**
  * Destroys all registered <code>Process</code>es when the VM exits.
@@ -30,7 +30,7 @@ import java.util.Vector;
  */
 class ProcessDestroyer implements Runnable {
     private static final int THREAD_DIE_TIMEOUT = 20000;
-    private Vector processes = new Vector();
+    private HashSet processes = new HashSet();
     // methods to register and unregister shutdown hooks
     private Method addShutdownHookMethod;
     private Method removeShutdownHookMethod;
@@ -183,8 +183,7 @@ class ProcessDestroyer implements Runnab
             if (processes.size() == 0) {
                 addShutdownHook();
             }
-            processes.addElement(process);
-            return processes.contains(process);
+            return processes.add(process);
         }
     }
 
@@ -198,7 +197,7 @@ class ProcessDestroyer implements Runnab
      */
     public boolean remove(Process process) {
         synchronized (processes) {
-            boolean processRemoved = processes.removeElement(process);
+            boolean processRemoved = processes.remove(process);
             if (processRemoved && processes.size() == 0) {
                 removeShutdownHook();
             }
@@ -212,9 +211,9 @@ class ProcessDestroyer implements Runnab
     public void run() {
         synchronized (processes) {
             running = true;
-            Enumeration e = processes.elements();
-            while (e.hasMoreElements()) {
-                ((Process) e.nextElement()).destroy();
+            Iterator e = processes.iterator();
+            while (e.hasNext()) {
+                ((Process) e.next()).destroy();
             }
         }
     }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Property.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Property.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Property.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Property.java Mon May  3 17:44:21 2010
@@ -279,7 +279,7 @@ public class Property extends Task {
      */
     public void setPrefix(String prefix) {
         this.prefix = prefix;
-        if (!prefix.endsWith(".")) {
+        if (prefix != null && !prefix.endsWith(".")) {
             this.prefix += ".";
         }
     }
@@ -542,7 +542,7 @@ public class Property extends Task {
                                 Properties props, InputStream is, boolean isXml) throws IOException {
         if (isXml) {
             // load the xml based property definition
-            // use reflection because of bwc to Java 1.3
+            // use reflection because of bwc to Java 1.4
             try {
                 Method loadXmlMethod = props.getClass().getMethod("loadFromXML",
                                                                   new Class[] {InputStream.class});
@@ -715,7 +715,8 @@ public class Property extends Task {
         new ResolvePropertyMap(
                                getProject(),
                                propertyHelper,
-                               propertyHelper.getExpanders()).resolveAllProperties(props);
+                               propertyHelper.getExpanders())
+            .resolveAllProperties(props, prefix);
     }
 
 }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java Mon May  3 17:44:21 2010
@@ -21,7 +21,6 @@ package org.apache.tools.ant.taskdefs;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import org.apache.tools.ant.taskdefs.condition.Os;
 
 /**
  * Copies standard output and error of subprocesses to standard output and
@@ -130,8 +129,6 @@ public class PumpStreamHandler implement
      * Stop pumping the streams.
      */
     public void stop() {
-        finish(outputThread);
-        finish(errorThread);
 
         if (inputPump != null) {
             inputPump.stop();
@@ -147,9 +144,11 @@ public class PumpStreamHandler implement
         } catch (IOException e) {
             // ignore
         }
+        finish(outputThread);
+        finish(errorThread);
     }
 
-    private static final long JOIN_TIMEOUT = 500;
+    private static final long JOIN_TIMEOUT = 200;
 
     /**
      * Waits for a thread to finish while trying to make it finish
@@ -161,11 +160,18 @@ public class PumpStreamHandler implement
      */
     protected final void finish(Thread t) {
         try {
-            t.join(JOIN_TIMEOUT);
             StreamPumper s = null;
             if (t instanceof ThreadWithPumper) {
                 s = ((ThreadWithPumper) t).getPumper();
             }
+            if (s != null && s.isFinished()) {
+                return;
+            }
+            if (!t.isAlive()) {
+                return;
+            }
+
+            t.join(JOIN_TIMEOUT);
             if (s != null && !s.isFinished()) {
                 s.stop();
             }
@@ -238,7 +244,7 @@ public class PumpStreamHandler implement
         final Thread result
             = new ThreadWithPumper(new StreamPumper(is, os,
                                                     closeWhenExhausted,
-                                                    Os.isFamily("windows")));
+                                                    true));
         result.setDaemon(true);
         return result;
     }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Rmic.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Rmic.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Rmic.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Rmic.java Mon May  3 17:44:21 2010
@@ -705,7 +705,8 @@ public class Rmic extends MatchingTask {
                 continue;
             }
             String sourceFileName = StringUtils.removeSuffix(generatedFile,
-                                                             ".class");
+                                                             ".class")
+                + ".java";
 
             File oldFile = new File(baseDir, sourceFileName);
             if (!oldFile.exists()) {

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/SQLExec.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/SQLExec.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/SQLExec.java Mon May  3 17:44:21 2010
@@ -1072,7 +1072,7 @@ public class SQLExec extends JDBCTask {
             // no match
             return -1;
         } else {
-            String d = delimiter.trim().toLowerCase(Locale.US);
+            String d = delimiter.trim().toLowerCase(Locale.ENGLISH);
             if (delimiterType.equals(DelimiterType.NORMAL)) {
                 // still trying to avoid wasteful copying, see
                 // StringUtils.endsWith
@@ -1087,7 +1087,7 @@ public class SQLExec extends JDBCTask {
                 }
                 while (endIndex >= 0) {
                     if (buf.substring(bufferIndex, bufferIndex + 1)
-                        .toLowerCase(Locale.US).charAt(0)
+                        .toLowerCase(Locale.ENGLISH).charAt(0)
                         != d.charAt(endIndex)) {
                         return -1;
                     }
@@ -1096,7 +1096,7 @@ public class SQLExec extends JDBCTask {
                 }
                 return bufferIndex + 1;
             } else {
-                return currentLine.trim().toLowerCase(Locale.US).equals(d)
+                return currentLine.trim().toLowerCase(Locale.ENGLISH).equals(d)
                     ? buf.length() - currentLine.length() : -1;
             }
         }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Tstamp.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Tstamp.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Tstamp.java Mon May  3 17:44:21 2010
@@ -324,7 +324,7 @@ public class Tstamp extends Task {
          * @return an int value.
          */
         public int getCalendarField() {
-            String key = getValue().toLowerCase();
+            String key = getValue().toLowerCase(Locale.ENGLISH);
             Integer i = (Integer) calendarFields.get(key);
             return i.intValue();
         }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/WaitFor.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/WaitFor.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/WaitFor.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/WaitFor.java Mon May  3 17:44:21 2010
@@ -19,6 +19,7 @@
 package org.apache.tools.ant.taskdefs;
 
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
@@ -259,7 +260,7 @@ public class WaitFor extends ConditionBa
          * @return a multipler (a long value)
          */
         public long getMultiplier() {
-            String key = getValue().toLowerCase();
+            String key = getValue().toLowerCase(Locale.ENGLISH);
             Long l = (Long) timeTable.get(key);
             return l.longValue();
         }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/War.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/War.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/War.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/War.java Mon May  3 17:44:21 2010
@@ -20,7 +20,6 @@ package org.apache.tools.ant.taskdefs;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.Locale;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.types.ZipFileSet;
@@ -61,9 +60,6 @@ public class War extends Jar {
     private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
     /** path to web.xml file */
     private static final String XML_DESCRIPTOR_PATH = "WEB-INF/web.xml";
-    /** lower case version for comparisons */
-    private static final String XML_DESCRIPTOR_PATH_LC =
-            XML_DESCRIPTOR_PATH.toLowerCase(Locale.ENGLISH);
 
     /** Constructor for the War Task. */
     public War() {
@@ -178,10 +174,9 @@ public class War extends Jar {
         // not the one specified in the "webxml" attribute - or if
         // it's being added twice, meaning the same file is specified
         // by the "webxml" attribute and in a <fileset> element.
-        String vPathLowerCase = vPath.toLowerCase(Locale.ENGLISH);
         //by default, we add the file.
         boolean addFile = true;
-        if (XML_DESCRIPTOR_PATH_LC.equals(vPathLowerCase)) {
+        if (XML_DESCRIPTOR_PATH.equalsIgnoreCase(vPath)) {
             //a web.xml file was found. See if it is a duplicate or not
             if (addedWebXmlFile != null) {
                 //a second web.xml file, so skip it

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java Mon May  3 17:44:21 2010
@@ -108,10 +108,6 @@ public class XSLTProcess extends Matchin
     /** for resolving entities such as dtds */
     private XMLCatalog xmlCatalog = new XMLCatalog();
 
-    /** Name of the TRAX Liaison class */
-    private static final String TRAX_LIAISON_CLASS =
-                        "org.apache.tools.ant.taskdefs.optional.TraXLiaison";
-
     /** Utilities used for file operations */
     private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
 
@@ -525,7 +521,6 @@ public class XSLTProcess extends Matchin
 
     /**
      * Set the name of the XSL processor to use; optional, default trax.
-     * Other values are "xalan" for Xalan1
      *
      * @param processor the name of the XSL processor
      */
@@ -675,15 +670,13 @@ public class XSLTProcess extends Matchin
      * @exception Exception if the processor cannot be loaded.
      */
     private void resolveProcessor(String proc) throws Exception {
-        String classname;
         if (proc.equals(PROCESSOR_TRAX)) {
-            classname = TRAX_LIAISON_CLASS;
+            liaison = new org.apache.tools.ant.taskdefs.optional.TraXLiaison();
         } else {
             //anything else is a classname
-            classname = proc;
+            Class clazz = loadClass(proc);
+            liaison = (XSLTLiaison) clazz.newInstance();
         }
-        Class clazz = loadClass(classname);
-        liaison = (XSLTLiaison) clazz.newInstance();
     }
 
     /**
@@ -906,8 +899,7 @@ public class XSLTProcess extends Matchin
      * @return an instance of the XSLTLiason interface.
      */
     protected XSLTLiaison getLiaison() {
-        // if processor wasn't specified, see if TraX is available.  If not,
-        // default it to xalan, depending on which is in the classpath
+        // if processor wasn't specified, use TraX.
         if (liaison == null) {
             if (processor != null) {
                 try {
@@ -918,8 +910,7 @@ public class XSLTProcess extends Matchin
             } else {
                 try {
                     resolveProcessor(PROCESSOR_TRAX);
-                } catch (Throwable e1) {
-                    e1.printStackTrace();
+                } catch (Exception e1) { // should not happen
                     handleError(e1);
                 }
             }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Zip.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Zip.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Zip.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/Zip.java Mon May  3 17:44:21 2010
@@ -1026,7 +1026,7 @@ public class Zip extends MatchingTask {
                 try {
                     is = zf.getInputStream(ze);
                     zipFile(is, zOut, prefix + name, ze.getTime(),
-                            fromArchive, mode, ze.getExtraFields());
+                            fromArchive, mode, ze.getExtraFields(true));
                 } finally {
                     doCompress = oldCompress;
                     FileUtils.close(is);
@@ -1723,7 +1723,7 @@ public class Zip extends MatchingTask {
         throws IOException {
         // fromArchive is used in subclasses overriding this method
 
-        if (entries.contains(vPath)) {
+        if (entries.containsKey(vPath)) {
 
             if (duplicate.equals("preserve")) {
                 logWhenWriting(vPath + " already added, skipping",

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java Mon May  3 17:44:21 2010
@@ -101,7 +101,7 @@ public final class CompilerAdapterFactor
             if (compilerType.equalsIgnoreCase("jikes")) {
                 return new Jikes();
             }
-            if (compilerType.equalsIgnoreCase("extJavac")) {
+            if (compilerType.equalsIgnoreCase("extjavac")) {
                 return new JavacExternal();
             }
             if (compilerType.equalsIgnoreCase("classic")

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Equals.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Equals.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Equals.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Equals.java Mon May  3 17:44:21 2010
@@ -32,6 +32,7 @@ public class Equals implements Condition
     private boolean trim = false;
     private boolean caseSensitive = true;
     private int args;
+    private boolean forcestring = false;
 
     /**
      * Set the first argument
@@ -107,6 +108,16 @@ public class Equals implements Condition
     }
 
     /**
+     * Set whether to force string comparisons for non-equal, non-string objects.
+     * This allows object properties (legal in Ant 1.8.x+) to be compared as strings.
+     * @param forcestring value to set
+     * @since Ant 1.8.1
+     */
+    public void setForcestring(boolean forcestring) {
+        this.forcestring = forcestring;
+    }
+
+    /**
      * @return true if the two strings are equal
      * @exception BuildException if the attributes are not set correctly
      */
@@ -114,7 +125,13 @@ public class Equals implements Condition
         if ((args & REQUIRED) != REQUIRED) {
             throw new BuildException("both arg1 and arg2 are required in equals");
         }
-
+        if (arg1 == arg2 || arg1 != null && arg1.equals(arg2)) {
+            return true;
+        }
+        if (forcestring) {
+            arg1 = arg1 == null || arg1 instanceof String ? arg1 : arg1.toString();
+            arg2 = arg2 == null || arg2 instanceof String ? arg2 : arg2.toString();
+        }
         if (arg1 instanceof String && trim) {
             arg1 = ((String) arg1).trim();
         }
@@ -126,6 +143,6 @@ public class Equals implements Condition
             String s2 = (String) arg2;
             return caseSensitive ? s1.equals(s2) : s1.equalsIgnoreCase(s2);
         }
-        return arg1 == arg2 || arg1 != null && arg1.equals(arg2);
+        return false;
     }
 }

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Http.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Http.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Http.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Http.java Mon May  3 17:44:21 2010
@@ -70,12 +70,12 @@ public class Http extends ProjectCompone
      *               such as "GET", "HEAD", "TRACE", etc. The default
      *               if not specified is "GET".
      *
-     * @see java.net.HttpURLConnection#setRequestMethod()
+     * @see java.net.HttpURLConnection#setRequestMethod
      * @since Ant 1.8.0
      */
     public void setRequestMethod(String method) {
         this.requestMethod = method == null ? DEFAULT_REQUEST_METHOD
-            : method.toUpperCase(Locale.US);
+            : method.toUpperCase(Locale.ENGLISH);
     }
 
     /**

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Os.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Os.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Os.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/condition/Os.java Mon May  3 17:44:21 2010
@@ -29,11 +29,11 @@ import org.apache.tools.ant.BuildExcepti
  */
 public class Os implements Condition {
     private static final String OS_NAME =
-        System.getProperty("os.name").toLowerCase(Locale.US);
+        System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
     private static final String OS_ARCH =
-        System.getProperty("os.arch").toLowerCase(Locale.US);
+        System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
     private static final String OS_VERSION =
-        System.getProperty("os.version").toLowerCase(Locale.US);
+        System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
     private static final String PATH_SEP =
         System.getProperty("path.separator");
 
@@ -142,7 +142,7 @@ public class Os implements Condition {
      *               </ul>
      */
     public void setFamily(String f) {
-        family = f.toLowerCase(Locale.US);
+        family = f.toLowerCase(Locale.ENGLISH);
     }
 
     /**
@@ -151,7 +151,7 @@ public class Os implements Condition {
      * @param name   The OS name
      */
     public void setName(String name) {
-        this.name = name.toLowerCase(Locale.US);
+        this.name = name.toLowerCase(Locale.ENGLISH);
     }
 
     /**
@@ -160,7 +160,7 @@ public class Os implements Condition {
      * @param arch   The OS architecture
      */
     public void setArch(String arch) {
-        this.arch = arch.toLowerCase(Locale.US);
+        this.arch = arch.toLowerCase(Locale.ENGLISH);
     }
 
     /**
@@ -169,7 +169,7 @@ public class Os implements Condition {
      * @param version   The OS version
      */
     public void setVersion(String version) {
-        this.version = version.toLowerCase(Locale.US);
+        this.version = version.toLowerCase(Locale.ENGLISH);
     }
 
     /**

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/defaults.properties
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/defaults.properties?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/defaults.properties (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/defaults.properties Mon May  3 17:44:21 2010
@@ -20,6 +20,7 @@ antstructure=org.apache.tools.ant.taskde
 antversion=org.apache.tools.ant.taskdefs.condition.AntVersion
 apply=org.apache.tools.ant.taskdefs.Transform
 apt=org.apache.tools.ant.taskdefs.Apt
+augment=org.apache.tools.ant.taskdefs.AugmentReference
 available=org.apache.tools.ant.taskdefs.Available
 basename=org.apache.tools.ant.taskdefs.Basename
 buildnumber=org.apache.tools.ant.taskdefs.BuildNumber
@@ -195,7 +196,6 @@ stcheckin=org.apache.tools.ant.taskdefs.
 stcheckout=org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckout
 stlabel=org.apache.tools.ant.taskdefs.optional.starteam.StarTeamLabel
 stlist=org.apache.tools.ant.taskdefs.optional.starteam.StarTeamList
-stylebook=org.apache.tools.ant.taskdefs.optional.StyleBook
 symlink=org.apache.tools.ant.taskdefs.optional.unix.Symlink
 telnet=org.apache.tools.ant.taskdefs.optional.net.TelnetTask
 translate=org.apache.tools.ant.taskdefs.optional.i18n.Translate

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/email/Message.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/email/Message.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/email/Message.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/email/Message.java Mon May  3 17:44:21 2010
@@ -141,7 +141,7 @@ public class Message extends ProjectComp
             }
             out.flush();
         } finally {
-            FileUtils.close(out);
+            //do not close the out writer as it is reused afterwards by the mail task
         }
     }
 

Modified: ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java
URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java?rev=940531&r1=940530&r2=940531&view=diff
==============================================================================
--- ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java (original)
+++ ant/core/branches/run-single-test-method/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java Mon May  3 17:44:21 2010
@@ -26,11 +26,12 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.UnsupportedEncodingException;
 
-import java.util.Vector;
+import java.util.Enumeration;
 import java.util.Iterator;
+import java.util.Locale;
 import java.util.Properties;
-import java.util.Enumeration;
 import java.util.StringTokenizer;
+import java.util.Vector;
 
 import java.security.Provider;
 import java.security.Security;
@@ -100,7 +101,7 @@ public class MimeMailer extends Mailer {
         }
 
         public void setContentType(String type) {
-            this.type = type.toLowerCase();
+            this.type = type.toLowerCase(Locale.ENGLISH);
         }
 
         public String getContentType() {



Mime
View raw message