RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length [v2]
Naoto Sato
naoto at openjdk.org
Thu Jul 21 18:41:09 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
src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java line 744:
> 742: }
> 743: } catch (Throwable x) {
> 744: System.out.println("Caught " + x);
Leftover debug output?
src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java line 749:
> 747: exc = x;
> 748: } finally {
> 749: System.out.println("finally");
As above
-------------
PR: https://git.openjdk.org/jdk/pull/9595
More information about the core-libs-dev
mailing list