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

Brian Burkhalter bpb at openjdk.org
Mon Aug 1 17:19:09 UTC 2022


On Thu, 21 Jul 2022 19:58:50 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> For a `String` “s”, `s.indexOf(int)` can never return a value `>= s.length()` so change the check
>> 
>>         int pos = syntaxAndInput.indexOf(':');
>>         if (pos <= 0 || pos == syntaxAndInput.length())
>> 
>> to
>> 
>>         if (pos <= 0)
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8290047: Remove IAE message in JrtFileSystem.getPathMatcher()

> Alternatively, change "where ':' stands for itself" to "where syntax and pattern components are non-empty strings and ':' stands for itself" so that it's up front when the input string is described.

I think that reads better; will change accordingly.

-------------

PR: https://git.openjdk.org/jdk/pull/9595


More information about the nio-dev mailing list