diff --git a/WHATSNEW b/WHATSNEW
index f01fb84e0..1f25ac778 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -91,6 +91,11 @@ Changes that could break older environments:
locale.
Bugzilla Report 44659.
+ *
Since Ant 1.8.0 this method will try to delete the File object if + * it reports it wouldn't exist (as symlinks pointing nowhere usually do). + * Prior version would throw a FileNotFoundException in that case.
* * @param linkfil AFile object of the symlink to delete.
*
@@ -403,7 +407,8 @@ public class Symlink extends DispatchTask {
public static void deleteSymlink(File linkfil)
throws IOException {
if (!linkfil.exists()) {
- throw new FileNotFoundException("No such symlink: " + linkfil);
+ linkfil.delete();
+ return;
}
// find the resource of the existing link:
File canfil = linkfil.getCanonicalFile();
diff --git a/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml b/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml
index 95b669f53..2a1cdfa02 100644
--- a/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml
+++ b/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml
@@ -62,4 +62,11 @@
resource="${file_ref}"/>
+