Skip to main content

JDK7 NIO2 Path.endsWith bug report

3 replies [Last post]
tankist
Offline
Joined: 2010-02-12
Points: 0

Hi!
Sorry for my English.
I use Fedora 12 x86_64 linux and jdk7 installed from binary package jdk-7-ea-bin-b82-linux-x64-04_feb_2010.bin.
When i try to run this code:
Path somePath = Paths.get("/home/v/one/two/thre");
Path ends = Paths.get("three");
boolean b = somePath.endsWith(ends);
i have error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 21
at sun.nio.fs.UnixPath.endsWith(UnixPath.java:662)
at javaapplication7.Main.main(Main.java:27)
Java Result: 1
If last element of "somePath" (in this example "thre" starts with same characters as "ends" and length biggerer than length of last element of "somePath" then i have ArrayIndexOutOfBoundsException.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alanb
Offline
Joined: 2005-08-08
Points: 0

There is indeed a bug here. Can you submit it to bugs.sun.com so that it gets into the bug database?

tankist
Offline
Joined: 2010-02-12
Points: 0

Now i send bug report.
Thank you for URI of bug reporting page. At first I was not attentive and have not found this page.

alanb
Offline
Joined: 2005-08-08
Points: 0

This one was fixed in b86 as 6925932.