<Swing Dev> RFR: PIT Bug 8167988 : java.nio.file.InvalidPathException if click button in JFileChooser demo of SwingSet2
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Mon Oct 24 23:11:51 UTC 2016
+1
On 25.10.16 1:26, Phil Race wrote:
> SQE reports some 35 tests fail as a result of this bug.
> I am backing out the change that caused it from our PIT and need a
> reviewer.
> SQE will verify this before I push.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8167988
>
> Fix :
>
> hg diff src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java
> diff --git
> a/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java
> b/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java
> --- a/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java
> +++ b/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java
> @@ -30,10 +30,6 @@
> 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.nio.file.Paths;
> import java.util.*;
> import java.util.concurrent.Callable;
>
> @@ -244,11 +240,10 @@
> * @exception FileNotFoundException if file does not exist
> */
> public static ShellFolder getShellFolder(File file) throws
> FileNotFoundException {
> - Path path = Paths.get(file.getPath());
> if (file instanceof ShellFolder) {
> return (ShellFolder)file;
> }
> - if (!Files.exists(path, LinkOption.NOFOLLOW_LINKS)) {
> + if (!file.exists()) {
> throw new FileNotFoundException();
> }
> return shellFolderManager.createShellFolder(file);
>
--
Best regards, Sergey.
More information about the swing-dev
mailing list