8290047: (fs) FileSystem.getPathMatcher does not check for ":" at last index

Reviewed-by: naoto, rriggs, alanb, lancea
This commit is contained in:
Brian Burkhalter 2022-08-09 17:07:14 +00:00
parent 8d0d9eaa9c
commit 4040927d17
8 changed files with 52 additions and 15 deletions

View file

@ -281,7 +281,7 @@ abstract class UnixFileSystem
@Override
public PathMatcher getPathMatcher(String syntaxAndInput) {
int pos = syntaxAndInput.indexOf(':');
if (pos <= 0 || pos == syntaxAndInput.length())
if (pos <= 0)
throw new IllegalArgumentException();
String syntax = syntaxAndInput.substring(0, pos);
String input = syntaxAndInput.substring(pos+1);