diff --git a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java index 90bf4d02389..2b48a58de01 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java @@ -30,6 +30,9 @@ import java.awt.Image; import java.awt.Toolkit; import java.io.*; import java.io.FileNotFoundException; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; import java.util.*; import java.util.concurrent.Callable; @@ -243,7 +246,8 @@ public abstract class ShellFolder extends File { if (file instanceof ShellFolder) { return (ShellFolder)file; } - if (!file.exists()) { + + if (!Files.exists(file.toPath(), LinkOption.NOFOLLOW_LINKS)) { throw new FileNotFoundException(); } return shellFolderManager.createShellFolder(file); diff --git a/jdk/test/java/awt/FileDialog/8017487/bug8017487.java b/jdk/test/java/awt/FileDialog/8017487/bug8017487.java index f3c3fbcc025..78056762187 100644 --- a/jdk/test/java/awt/FileDialog/8017487/bug8017487.java +++ b/jdk/test/java/awt/FileDialog/8017487/bug8017487.java @@ -22,7 +22,7 @@ */ /* @test - @bug 8017487 + @bug 8017487 8167988 @summary filechooser in Windows-Libraries folder: columns are mixed up @author Semyon Sadetsky @modules java.desktop/sun.awt.shell