#225 antcallback and antfetch does not recognize parameter

open
nobody
property (13)
5
2008-09-08
2008-09-08
Xuetao Niu
No

Hi,

The user manual of antcallback and antfetch describes as identical behavior as antcall and ant tasks except for that they support returning values. But they do not do the same as described -- the target-call perematers are overruled by the global properties with the same name, whereas antcall and ant do use the parameter property name as local scope properties to overrule any more global ones.

To me it is a bug because if you define any global property with the same name as the parameter, your entire script logic will be destroyed!

Check the following code and run target "test":

<target name="test1">

<!-- expect to see 1 -->
<property name="param" value="1" />
<antcall target="callme" />

<!-- expect to see 2 -->
<antcall target="callme" >
<param name="param" value="2" />
</antcall>

<!-- expect to see 1-->
<antcallback target="callme" />

<!-- expect to see 2, but 1 will be shown!!! -->
<antcallback target="callme" >
<param name="param" value="2"/>
</antcallback>

</target>

<!--
suppose to accept parameter named "param"
-->
<target name="callme">
<echo>${param}</echo>
</target>

Same goes for <antfetch> task.

Regards,

Xuetao

Discussion