changeset 16011:d13621cb40df

8168899: java.nio.file.InvalidPathException if click button in JFileChooser demo of SwingSet2 Reviewed-by: ssadetsky, serb Contributed-by: Alok Kumar Sharma <alok.sharma@hpe.com>
author alexsch
date Tue, 01 Nov 2016 12:38:34 +0300
parents f970d80b7a55
children 3bddef7033e5
files src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java test/java/awt/FileDialog/8017487/bug8017487.java
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java	Mon Oct 31 10:39:14 2016 -0700
+++ b/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java	Tue Nov 01 12:38:34 2016 +0300
@@ -30,6 +30,9 @@
 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 @@
         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);
--- a/test/java/awt/FileDialog/8017487/bug8017487.java	Mon Oct 31 10:39:14 2016 -0700
+++ b/test/java/awt/FileDialog/8017487/bug8017487.java	Tue Nov 01 12:38:34 2016 +0300
@@ -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