Hi Phil,
"Vagueness that it is an nio problem without pointing to why just makes me have to investigate it myself to see why .. I'd prefer that the bug owner do that :-)" I did provide a standalone program, that reproduces the exact exception reported in the bug. Just repeating it here again for reference: import java.nio.file.Paths; public class PathExceptionBug { public static void main(String args[]) throws Exception { Paths.get("C:\\testspace "); } } When Sergey pointed out the bug(JDK-6578565), and suggested that NIO may close it, then we discussed about fixing it in our code, instead of assigning it to them. Thanks, Krishna From: Phil Race Sent: Friday, February 16, 2018 10:38 PM To: Krishna Addepalli <krishna.addepa...@oracle.com>; Semyon Sadetsky <semyon.sadet...@oracle.com>; swing-dev@openjdk.java.net Subject: Re: <Swing Dev> [11][JDK-8196673] JFileChooser throws InvalidPathException when changing to directory with added space Right, what I said was that perhaps nio is behaving as specified in this case. If a standalone nio program can be written that shows nio contravening its spec. then a bug should be raised against nio. I did not verify what the case is there .. I just suggested that should be investigated. Vagueness that it is an nio problem without pointing to why just makes me have to investigate it myself to see why .. I'd prefer that the bug owner do that :-) But otherwise (no nio bug) we'll have to deal with what nio specifies. If we can fix it locally *and* file a bug against nio then that is also an issue. Also nio may take a while to get to it .. -phil On 02/16/2018 08:56 AM, Krishna Addepalli wrote: Hi Semyon, I had a discussion with Sergey,Phil regarding this. While there was a similar bug filed against Core-libs (https://bugs.openjdk.java.net/browse/JDK-6578565) , it was closed out as not an issue. I have checked it on Java8, and it behaves correctly on Windows - it trims the paths and then creates/selects the folder. >From Java9 onwards, the InvalidPathException is thrown, since ShellFolder.java >file uses nio to get the path, and the nio throws the exception as reported in >the bug. Phil suggested that, we should fix the bug at our level if we can, since nio may not consider this to be a problem at their level. Hence this suggested fix. Thanks, Krishna From: Semyon Sadetsky Sent: Friday, February 16, 2018 10:04 PM To: Krishna Addepalli HYPERLINK "mailto:krishna.addepa...@oracle.com"<krishna.addepa...@oracle.com>; HYPERLINK "mailto:swing-dev@openjdk.java.net"swing-dev@openjdk.java.net Subject: Re: <Swing Dev> [11][JDK-8196673] JFileChooser throws InvalidPathException when changing to directory with added space According to Pardeep Sharma comment the bug is reproducible since 6u45. Do you confirm this or it is a regression introduced in 9? >From the stack trace it doesn't look as a client-libs issue but a NIO issue. --Semyon On 02/16/2018 04:40 AM, Krishna Addepalli wrote: Hi Sergey, Phil Please review a fix for JDK-8196673: https://bugs.openjdk.java.net/browse/JDK-8196673 Webrev: HYPERLINK "http://cr.openjdk.java.net/%7Ekaddepalli/8196673/webrev00"http://cr.openjdk.java.net/~kaddepalli/8196673/webrev00 The problem is in Java9 and later, when a directory path that contains leading/trailing space is provided, it throws an InvalidPathException. As per Phil's recommendation, I have added a simple fix, which will trim the path for Windows, whereas for other platforms, it keeps it as it is. Thanks, Krishna