This is an automated email from the ASF dual-hosted git repository.

bodewig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ant.git

commit f494eb279f9e0465a33ad1d3a4db4a400b3879bc
Author: Stefan Bodewig <[email protected]>
AuthorDate: Fri Feb 6 20:40:50 2026 +0100

    of course NIO needs its own exception for "file not found"
---
 src/main/org/apache/tools/ant/util/FileUtils.java         | 2 ++
 src/main/org/apache/tools/ant/util/NtfsJunctionUtils.java | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/src/main/org/apache/tools/ant/util/FileUtils.java 
b/src/main/org/apache/tools/ant/util/FileUtils.java
index 03885145b..e6b49b75f 100644
--- a/src/main/org/apache/tools/ant/util/FileUtils.java
+++ b/src/main/org/apache/tools/ant/util/FileUtils.java
@@ -2019,6 +2019,8 @@ public class FileUtils {
                 return f.toPath().toRealPath().toString();
             } catch (FileNotFoundException ex) {
                 // file or link target doesn't exist, fall back to 
getCanonicalPath
+            } catch (NoSuchFileException ex) {
+                // file or link target doesn't exist, fall back to 
getCanonicalPath
             }
         }
         return f.getCanonicalPath();
diff --git a/src/main/org/apache/tools/ant/util/NtfsJunctionUtils.java 
b/src/main/org/apache/tools/ant/util/NtfsJunctionUtils.java
index e86295879..ea46ef648 100644
--- a/src/main/org/apache/tools/ant/util/NtfsJunctionUtils.java
+++ b/src/main/org/apache/tools/ant/util/NtfsJunctionUtils.java
@@ -22,6 +22,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.LinkOption;
+import java.nio.file.NoSuchFileException;
 import java.nio.file.Path;
 import java.nio.file.attribute.BasicFileAttributes;
 
@@ -89,6 +90,8 @@ public class NtfsJunctionUtils {
             return isDirectoryJunction(path);
         } catch (FileNotFoundException ex) {
             // ignore
+        } catch (NoSuchFileException ex) {
+            // ignore
         } catch (IOException ex) {
             System.err.println("Caught IOException " + ex.getMessage() + " 
while testing for junction.");
         }

Reply via email to