Author: mbenson
Date: Thu Feb 25 17:47:07 2010
New Revision: 916372
URL: http://svn.apache.org/viewvc?rev=916372&view=rev
Log:
Bug 48816 - If <concat>'s first resourcecollection child is a <resources>, any
subsequently added child resourcecollection joins the first
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Concat.java
Modified: ant/core/trunk/WHATSNEW
URL:
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=916372&r1=916371&r2=916372&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Feb 25 17:47:07 2010
@@ -37,7 +37,11 @@
Bugzilla Report 48746
* SymlinkTest#testSymbolicLinkUtilsMethods failing on MacOS
- Bugzilla Report 48785.
+ Bugzilla Report 48785.
+
+* If <concat>'s first resourcecollection child is a <resources>,
+ any subsequently added child resourcecollection joins the first.
+ Bugzilla Report 48816.
Other changes:
--------------
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Concat.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Concat.java?rev=916372&r1=916371&r2=916372&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Concat.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Concat.java Thu Feb
25 17:47:07 2010
@@ -465,7 +465,7 @@
* 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 @@
* @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);
}
/**