ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 42046] properties get double-expanded in macrodefs
Date Wed, 08 Feb 2012 16:40:36 GMT

Jesse Glick <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #8 from Jesse Glick <> 2012-02-08 16:40:36 UTC ---
Due to regressions like that described in bug #52621, probably this fix needs
to be opt-in, since I can imagine various other scenarios where the former
behavior (call by value) is wanted and a change (call by name) would be

Suggest introducing an attribute on macrodef like 'expands' which would be true
by default; those users who have struggled with double expansion in the past
can explicitly set it to false, but others would be unaffected:

  <macrodef name="echotest" expands="false">
    <attribute name="message"/>
      <echo message="@{message}"/>
  </macrodef> would then read:

if (target instanceof MacroInstance &&
    !((MacroInstance) target).getMacroDef().isExpands()) {
  attrValue = value;
} else {
  attrValue = PropertyHelper.getPropertyHelper(p).parseProperties(value);

With a slightly more complex patch, the <attribute> nested element could
individually have an expansion attribute:

  <macrodef name="echotest">
    <attribute name="message" expands="false"/>
      <echo message="@{message}"/>

(Not sure if the same consideration applies to <text> and/or <element>.)

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message