From 11726913314bafc8d9b68ccc7d7855f1d77a15b3 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 13 Oct 2000 09:43:47 +0000 Subject: [PATCH] Reset destDir to null in if destFile has been set. This allows a single instance of Copy to be used more than one - like in ant -Dant.install=../dist/jakarta-ant dist install where the second time the dist target gets executed would throw an exception. You can see this in the logs of recent nightly builds of Ant. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268084 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Copy.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/org/apache/tools/ant/taskdefs/Copy.java b/src/main/org/apache/tools/ant/taskdefs/Copy.java index f07d7937d..3d947e795 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Copy.java +++ b/src/main/org/apache/tools/ant/taskdefs/Copy.java @@ -191,6 +191,12 @@ public class Copy extends Task { // do all the copy operations now... doFileOperations(); + + // clean up destDir again - so this instance can be used a second + // time without throwing an exception + if (destFile != null) { + destDir = null; + } } //************************************************************************