Re: RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length [v2]

2022-07-21 Thread Brian Burkhalter
On Thu, 21 Jul 2022 18:37:25 GMT, Naoto Sato wrote: >> 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/UnixAsynchronousSocketC

Re: RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length [v2]

2022-07-21 Thread Roger Riggs
On Thu, 21 Jul 2022 18:29:03 GMT, Brian Burkhalter 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 >> >>

Re: RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length [v2]

2022-07-21 Thread Brian Burkhalter
On Thu, 21 Jul 2022 18:36:57 GMT, Naoto Sato wrote: >> 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/UnixAsynchronousSocketC

Re: RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length [v2]

2022-07-21 Thread Naoto Sato
On Thu, 21 Jul 2022 18:29:03 GMT, Brian Burkhalter 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 >> >>

Re: RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length [v2]

2022-07-21 Thread Brian Burkhalter
On Thu, 21 Jul 2022 17:13:58 GMT, Brian Burkhalter wrote: >> src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystem.java line 178: >> >>> 176: public PathMatcher getPathMatcher(String syntaxAndInput) { >>> 177: int pos = syntaxAndInput.indexOf(':'); >>> 178: if (pos <=

Re: RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length [v2]

2022-07-21 Thread Brian Burkhalter
> 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 incr

Re: RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length

2022-07-21 Thread Roger Riggs
On Thu, 21 Jul 2022 15:29:10 GMT, Brian Burkhalter 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 (p

Re: RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length

2022-07-21 Thread Brian Burkhalter
On Thu, 21 Jul 2022 17:10:12 GMT, Roger Riggs 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 >> >> i

Re: RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length

2022-07-21 Thread Naoto Sato
On Thu, 21 Jul 2022 15:29:10 GMT, Brian Burkhalter 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 (p

RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length

2022-07-21 Thread Brian Burkhalter
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) - Commit messages: - 8290047: (fs) FileSystem.getPathM