From 0591bc2592ad3204e91258cc8f0ae6ff4b2f420f Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 12 Jan 2010 05:25:34 +0000 Subject: [PATCH] try to delete temporary files in fixcrlf. PR 48506. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@898183 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 3 +++ src/main/org/apache/tools/ant/taskdefs/FixCRLF.java | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/WHATSNEW b/WHATSNEW index 767edf50a..a70370f13 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -9,6 +9,9 @@ Changes that could break older environments: Fixed bugs: ----------- + * now tries earlier to delete the created temporary files. + Bugzilla Report 48506. + Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java b/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java index 65d1fa538..70e2f4d21 100644 --- a/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java +++ b/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java @@ -376,10 +376,13 @@ public class FixCRLF extends MatchingTask implements ChainableReader { Project.MSG_DEBUG); FILE_UTILS.setFileLastModified(destFile, lastModified); } - tmpFile = null; } } catch (IOException e) { throw new BuildException("error running fixcrlf on file " + srcFile, e); + } finally { + if (tmpFile != null && tmpFile.exists()) { + FILE_UTILS.tryHardToDelete(tmpFile); + } } }