diff --git a/WHATSNEW b/WHATSNEW index f87562b20..3d4a39832 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -37,7 +37,11 @@ Fixed bugs: Bugzilla Report 48746 * SymlinkTest#testSymbolicLinkUtilsMethods failing on MacOS - Bugzilla Report 48785. + Bugzilla Report 48785. + +* If 's first resourcecollection child is a , + any subsequently added child resourcecollection joins the first. + Bugzilla Report 48816. Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/Concat.java b/src/main/org/apache/tools/ant/taskdefs/Concat.java index a4e6b301c..9a8c433bf 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Concat.java +++ b/src/main/org/apache/tools/ant/taskdefs/Concat.java @@ -465,7 +465,7 @@ public class Concat extends Task implements ResourceCollection { * Stores a collection of file sets and/or file lists, used to * select multiple files for concatenation. */ - private ResourceCollection rc; + private Resources rc; /** for filtering the concatenated */ private Vector filterChains; @@ -634,19 +634,15 @@ public class Concat extends Task implements ResourceCollection { * @param c the ResourceCollection to add. * @since Ant 1.7 */ - public synchronized void add(ResourceCollection c) { - if (rc == null) { - rc = c; - return; - } - if (!(rc instanceof Resources)) { - Resources newRc = new Resources(); - newRc.setProject(getProject()); - newRc.setCache(true); - newRc.add(rc); - rc = newRc; + public void add(ResourceCollection c) { + synchronized (this) { + if (rc == null) { + rc = new Resources(); + rc.setProject(getProject()); + rc.setCache(true); + } } - ((Resources) rc).add(c); + rc.add(c); } /**