PR: 27175 Reported by: Jayson Raymond git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276144 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -48,6 +48,8 @@ Fixed bugs: | |||||
| * SQL task did not work with Informix IDS 9.2. Bugzilla Report 27162. | * 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: | Other changes: | ||||
| -------------- | -------------- | ||||
| @@ -156,4 +156,16 @@ | |||||
| </macrodef> | </macrodef> | ||||
| <escape a="avalue" b="bvalue"/> | <escape a="avalue" b="bvalue"/> | ||||
| </target> | </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> | </project> | ||||
| @@ -282,6 +282,9 @@ public class MacroInstance extends Task implements DynamicConfigurator { | |||||
| for (Iterator i = macroDef.getAttributes().iterator(); i.hasNext();) { | for (Iterator i = macroDef.getAttributes().iterator(); i.hasNext();) { | ||||
| MacroDef.Attribute attribute = (MacroDef.Attribute) i.next(); | MacroDef.Attribute attribute = (MacroDef.Attribute) i.next(); | ||||
| String value = (String) map.get(attribute.getName()); | String value = (String) map.get(attribute.getName()); | ||||
| if (value == null && "description".equals(attribute.getName())) { | |||||
| value = getDescription(); | |||||
| } | |||||
| if (value == null) { | if (value == null) { | ||||
| value = attribute.getDefault(); | value = attribute.getDefault(); | ||||
| value = macroSubs(value, localProperties); | value = macroSubs(value, localProperties); | ||||
| @@ -104,5 +104,10 @@ public class MacroDefTest extends BuildFileTest { | |||||
| "escape", | "escape", | ||||
| "a@b or a@b is avalue@bvalue"); | "a@b or a@b is avalue@bvalue"); | ||||
| } | } | ||||
| public void testAttributeDescription() { | |||||
| expectLog( | |||||
| "attribute.description", | |||||
| "description is hello world"); | |||||
| } | |||||
| } | } | ||||