diff --git a/WHATSNEW b/WHATSNEW index 9d738dfa7..a58f3c462 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -100,6 +100,12 @@ Fixed bugs: tasks were trying to create the same directory. Bugzilla Report 49572. + * the toString() method of the Resources class - and thus any + ${toString:} expansion of a reference to a element - + didn't iterate over its nested elements if it hadn't done so prior + to the toString invocation already. + Bugzilla Report 49588. + Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/types/resources/Resources.java b/src/main/org/apache/tools/ant/types/resources/Resources.java index 99143739b..1599bb80a 100644 --- a/src/main/org/apache/tools/ant/types/resources/Resources.java +++ b/src/main/org/apache/tools/ant/types/resources/Resources.java @@ -208,6 +208,7 @@ public class Resources extends DataType implements ResourceCollection { if (isReference()) { return getCheckedRef().toString(); } + validate(); if (coll == null || coll.isEmpty()) { return ""; } diff --git a/src/tests/antunit/types/resources/resources-test.xml b/src/tests/antunit/types/resources/resources-test.xml new file mode 100644 index 000000000..19985c721 --- /dev/null +++ b/src/tests/antunit/types/resources/resources-test.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + +