diff --git a/src/main/org/apache/tools/ant/taskdefs/Concat.java b/src/main/org/apache/tools/ant/taskdefs/Concat.java index 3c894a6e8..f104e2d18 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Concat.java +++ b/src/main/org/apache/tools/ant/taskdefs/Concat.java @@ -388,21 +388,27 @@ public class Concat extends Task { BufferedReader in = null; try { - OutputStream os = null; if (destinationFile == null) { // Log using WARN so it displays in 'quiet' mode. - os = new LogOutputStream(this, Project.MSG_WARN); + out = new PrintWriter( + new OutputStreamWriter( + new LogOutputStream(this, Project.MSG_WARN) + ) + ); } else { - os = - new FileOutputStream(destinationFile.getAbsolutePath(), - append); + out = new PrintWriter( + new OutputStreamWriter( + new FileOutputStream(destinationFile + .getAbsolutePath(), + append), + encoding) + ); // This flag should only be recognized for the first // file. In the context of a single 'cat', we always // want to append. append = true; } - out = new PrintWriter(new OutputStreamWriter(os, encoding)); for (int i = 0; i < len; i++) { in = new BufferedReader( diff --git a/src/testcases/org/apache/tools/ant/taskdefs/WarTest.java b/src/testcases/org/apache/tools/ant/taskdefs/WarTest.java index d09f90aa4..303cf18a7 100644 --- a/src/testcases/org/apache/tools/ant/taskdefs/WarTest.java +++ b/src/testcases/org/apache/tools/ant/taskdefs/WarTest.java @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2002 The Apache Software Foundation. All rights + * Copyright (c) 2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without