From 51446ae680d5ef730da476079fa517836bc49c3a Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 13 Jul 2010 11:58:59 +0000 Subject: [PATCH] Resources#toString relies on cache too much. PR 49588 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@963687 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 6 ++++ .../tools/ant/types/resources/Resources.java | 1 + .../types/resources/resources-test.xml | 32 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 src/tests/antunit/types/resources/resources-test.xml 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 @@ + + + + + + + + + + + + + + + +