[9] RFC on 8066943: (fs) Path.relativize() gives incorrect result for ".." on Windows
Alan Bateman
Alan.Bateman at oracle.com
Fri May 1 15:31:49 UTC 2015
On 01/05/2015 16:22, Brian Burkhalter wrote:
> This issue https://bugs.openjdk.java.net/browse/JDK-8066943 looks to
> me to be “Not an Issue.” Using JDK 9 this test class
>
> import java.nio.file.Path;
> import java.nio.file.Paths;
>
> public class JDK8066943 {
>
> public static void main(String[] args) throws Throwable {
> System.out.println(Paths.get("..").relativize(Paths.get("x")));
>
> System.out.println(Paths.get("").relativize(Paths.get("x")));
> }
> }
>
> prints
>
> ../x
> x
>
> on Unix (Mac OS 10.9.5 and Ubuntu 12.04) and
>
> ..\x
> x
>
> on Windows 7.
I think this is one that I talked to Max about at one point. It should
throw IAE for this case because you can't generate a general path for
$PWD/x. This is tricky to get right.
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20150501/c67d19f3/attachment-0001.html>
More information about the nio-dev
mailing list