RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length [v2]
Roger Riggs
rriggs at openjdk.org
Thu Jul 21 18:56:13 UTC 2022
On Thu, 21 Jul 2022 18:29:03 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: Ensure that colon is not at the last index
Please update the issue title and description and PR title and description to match the new understanding.
The IAE message in JrtFileSystem wording is a bit like it is leftover debugging output.
The messages for all 4 IAE could be something as simple as "missing pattern".
-------------
Changes requested by rriggs (Reviewer).
PR: https://git.openjdk.org/jdk/pull/9595
More information about the core-libs-dev
mailing list