peterreilly 2004/02/24 01:30:30
Modified: src/main/org/apache/tools/ant/taskdefs MacroInstance.java
src/etc/testcases/taskdefs macrodef.xml
src/testcases/org/apache/tools/ant/taskdefs
MacroDefTest.java
. WHATSNEW
Log:
MacroDef did not allow attributes named 'description'.
PR: 27175
Reported by: Jayson Raymond
Revision Changes Path
1.24 +3 -0
ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
Index: MacroInstance.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- MacroInstance.java 19 Feb 2004 11:01:20 -0000 1.23
+++ MacroInstance.java 24 Feb 2004 09:30:29 -0000 1.24
@@ -282,6 +282,9 @@
for (Iterator i = macroDef.getAttributes().iterator(); i.hasNext();)
{
MacroDef.Attribute attribute = (MacroDef.Attribute) i.next();
String value = (String) map.get(attribute.getName());
+ if (value == null && "description".equals(attribute.getName())) {
+ value = getDescription();
+ }
if (value == null) {
value = attribute.getDefault();
value = macroSubs(value, localProperties);
1.11 +12 -0 ant/src/etc/testcases/taskdefs/macrodef.xml
Index: macrodef.xml
===================================================================
RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/macrodef.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- macrodef.xml 19 Feb 2004 11:01:20 -0000 1.10
+++ macrodef.xml 24 Feb 2004 09:30:30 -0000 1.11
@@ -156,4 +156,16 @@
</macrodef>
<escape a="avalue" b="bvalue"/>
</target>
+
+ <target name="attribute.description">
+ <macrodef name="d">
+ <attribute name="description"/>
+ <attribute name="d" default="p"/>
+ <sequential>
+ <echo>description is @{description}</echo>
+ </sequential>
+ </macrodef>
+ <d description="hello world"/>
+ </target>
+
</project>
1.15 +5 -0
ant/src/testcases/org/apache/tools/ant/taskdefs/MacroDefTest.java
Index: MacroDefTest.java
===================================================================
RCS file:
/home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/MacroDefTest.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- MacroDefTest.java 19 Feb 2004 11:01:20 -0000 1.14
+++ MacroDefTest.java 24 Feb 2004 09:30:30 -0000 1.15
@@ -104,5 +104,10 @@
"escape",
"[EMAIL PROTECTED] or [EMAIL PROTECTED] is [EMAIL PROTECTED]");
}
+ public void testAttributeDescription() {
+ expectLog(
+ "attribute.description",
+ "description is hello world");
+ }
}
1.551 +2 -0 ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/ant/WHATSNEW,v
retrieving revision 1.550
retrieving revision 1.551
diff -u -r1.550 -r1.551
--- WHATSNEW 24 Feb 2004 09:19:57 -0000 1.550
+++ WHATSNEW 24 Feb 2004 09:30:30 -0000 1.551
@@ -48,6 +48,8 @@
* SQL task did not work with Informix IDS 9.2. Bugzilla Report 27162.
+* MacroDef did not allow attributes named 'description'. Bugzilla Report
27175.
+
Other changes:
--------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]