Author: peterreilly
Date: Tue Oct 3 14:35:06 2006
New Revision: 452635
URL: http://svn.apache.org/viewvc?view=rev&rev=452635
Log:
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.
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/RuntimeConfigurable.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/RuntimeConfigurable.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/RuntimeConfigurable.java?view=diff&rev=452635&r1=452634&r2=452635
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/RuntimeConfigurable.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/RuntimeConfigurable.java Tue
Oct 3 14:35:06 2006
@@ -70,6 +70,12 @@
* 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 @@
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;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]