Browse Source

Always handle refid first.

Refid normally cannot be used with other
attributes and some types check for this.
The code is broken in a number of places -
if refid is not set first. To fix this,
runtimeconfigurable will now always process
refid first.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@452635 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
ef789dfa9b
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      src/main/org/apache/tools/ant/RuntimeConfigurable.java

+ 11
- 1
src/main/org/apache/tools/ant/RuntimeConfigurable.java View File

@@ -70,6 +70,12 @@ public class RuntimeConfigurable implements Serializable {
* We could also just use SAX2 Attributes and convert to SAX1 ( DOM
* attribute Nodes can also be stored in SAX2 Attributes )
* XXX under JDK 1.4 you can just use a LinkedHashMap for this purpose -jglick
* The only exception to this order is the treatment of
* refid. A number of datatypes check if refid is set
* when other attributes are set. This check will not
* work if the build script has the other attribute before
* the "refid" attribute, so now (ANT 1.7) the refid
* attribute will be processed first.
*/
private List/*<String>*/ attributeNames = null;

@@ -185,7 +191,11 @@ public class RuntimeConfigurable implements Serializable {
attributeNames = new ArrayList();
attributeMap = new HashMap();
}
attributeNames.add(name);
if (name.toLowerCase(Locale.US).equals("refid")) {
attributeNames.add(0, name);
} else {
attributeNames.add(name);
}
attributeMap.put(name, value);
if (name.equals("id")) {
this.id = value;


Loading…
Cancel
Save