Need reviewer for 6925932: (file) Path.endsWith can throw ArrayIndexOutOfBoundsException (unx)

Christopher Hegarty - Sun Microsystems Ireland Christopher.Hegarty at Sun.COM
Fri Feb 19 05:30:02 PST 2010

Looks fine.

Trivially, I would retrieve and store path.length and that.path.length 
in locals after checkPath(other), to prevent retrieving their values 
potentially more than once.


On 12/02/2010 16:09, Alan Bateman wrote:
> This is small bug in the Unix implementation of Path.endsWith. Where the
> given path has fewer name elements than the base path but they are
> longer than the corresponding name elements in the base path then the
> comparison can fail with ArrayIndexOutOfBoundException. The reason is
> that the original implementation is missing a length check and is
> trivially fixed. The webrev is here and the test cases expanded to
> better exercise this method:
> Thanks,
> Alan.

More information about the nio-dev mailing list