8168899: java.nio.file.InvalidPathException if click button in JFileChooser demo of SwingSet2

Reviewed-by: ssadetsky, serb
This commit is contained in:
Alok Kumar Sharma 2016-11-01 12:38:34 +03:00 committed by Alexander Scherbatiy
parent b3ad5b94c3
commit abaaf58cf3
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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