PR: 14310 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273518 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -42,6 +42,9 @@ Fixed bugs: | |||||
| * <replace> would count some internal character replacements when | * <replace> would count some internal character replacements when | ||||
| reporting the number of replaced tokens. | reporting the number of replaced tokens. | ||||
| * <concat> would cause an exception if a <filelist> pointed to files | |||||
| that do not exist. | |||||
| Other changes: | Other changes: | ||||
| -------------- | -------------- | ||||
| @@ -31,4 +31,10 @@ | |||||
| <concat>Hello, ${world}!</concat> | <concat>Hello, ${world}!</concat> | ||||
| </target> | </target> | ||||
| <target name="test6"> | |||||
| <concat destfile="TESTDEST" append="true"> | |||||
| <filelist dir="${basedir}" files="thisfiledoesnotexist"/> | |||||
| </concat> | |||||
| </target> | |||||
| </project> | </project> | ||||
| @@ -298,9 +298,8 @@ public class Concat extends Task { | |||||
| private void catFiles(File base, String[] files) { | private void catFiles(File base, String[] files) { | ||||
| // First, create a list of absolute paths for the input files. | // First, create a list of absolute paths for the input files. | ||||
| final int len = files.length; | |||||
| String[] input = new String[len]; | |||||
| for (int i = 0; i < len; i++) { | |||||
| Vector inputFileNames = new Vector(); | |||||
| for (int i = 0; i < files.length; i++) { | |||||
| File current = new File(base, files[i]); | File current = new File(base, files[i]); | ||||
| @@ -314,9 +313,13 @@ public class Concat extends Task { | |||||
| continue; | continue; | ||||
| } | } | ||||
| input[i] = current.getAbsolutePath(); | |||||
| inputFileNames.addElement(current.getAbsolutePath()); | |||||
| } | } | ||||
| final int len = inputFileNames.size(); | |||||
| String[] input = new String[len]; | |||||
| inputFileNames.copyInto(input); | |||||
| // Next, perform the concatenation. | // Next, perform the concatenation. | ||||
| if (encoding == null) { | if (encoding == null) { | ||||
| OutputStream os = null; | OutputStream os = null; | ||||
| @@ -161,4 +161,9 @@ public class ConcatTest | |||||
| expectLog("test5", "Hello, World!"); | expectLog("test5", "Hello, World!"); | ||||
| } | } | ||||
| public void test6() { | |||||
| expectLogContaining("test6", | |||||
| "src/etc/testcases/taskdefs/thisfiledoesnotexist does not exist."); | |||||
| } | |||||
| } | } | ||||