ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Jenkins build became unstable: Ant-Build-Matrix-master-Linux » JDK 1.8 (latest) #977
Date Sun, 10 Dec 2017 09:43:07 GMT
On 2017-12-10, Stefan Bodewig wrote:

> testCreateDoubleHanging is related to
> https://bz.apache.org/bugzilla/show_bug.cgi?id=38199 judging from the
> history. Here the link points to a non-existent file and Files.exists
> returns false in Java8.

fixed by

@@ -37,6 +37,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintStream;
 import java.nio.file.Files;
+import java.nio.file.LinkOption;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
@@ -440,7 +441,7 @@ public class Symlink extends DispatchTask {
     private void doLink(String res, String lnk) throws BuildException {
         final Path link = Paths.get(lnk);
         final Path target = Paths.get(res);
-        final boolean alreadyExists = Files.exists(link);
+        final boolean alreadyExists = Files.exists(link, LinkOption.NOFOLLOW_LINKS);
         if (!alreadyExists) {
             // if the path (at which the link is expected to be created) isn't already present
             // then we just go ahead and attempt to symlink


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message