Re: RFR: 8294008: Grapheme implementation of setText() throws IndexOutOfBoundsException [v3]

2022-09-20 Thread Stuart Marks
On Tue, 20 Sep 2022 01:09:29 GMT, Naoto Sato wrote: >> OK yeah this is really confusing. One might ask a similar question in >> `charAt` about why it doesn't call >> >> src.setIndex(index + src.getBeginIndex()); >> >> The answer is that this is a special-purpose `CharSequence` that represe

Re: RFR: 8294008: Grapheme implementation of setText() throws IndexOutOfBoundsException [v3]

2022-09-20 Thread Stuart Marks
On Tue, 20 Sep 2022 01:14:38 GMT, Naoto Sato wrote: >> Fixing JCK failures caused by the new grapheme implementation. The length of >> a CharSequence should return the `endIndex`, not `endIndex - beginIndex`. > > Naoto Sato has updated the pull request incrementally with one additional > commit

Re: RFR: 8294008: Grapheme implementation of setText() throws IndexOutOfBoundsException [v3]

2022-09-19 Thread Naoto Sato
On Mon, 19 Sep 2022 23:04:12 GMT, Stuart Marks wrote: >> Thanks, Joe. Added comment to the method. > > OK yeah this is really confusing. One might ask a similar question in > `charAt` about why it doesn't call > > src.setIndex(index + src.getBeginIndex()); > > The answer is that this is a

Re: RFR: 8294008: Grapheme implementation of setText() throws IndexOutOfBoundsException [v3]

2022-09-19 Thread Naoto Sato
> Fixing JCK failures caused by the new grapheme implementation. The length of > a CharSequence should return the `endIndex`, not `endIndex - beginIndex`. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Refine the comments by adding cl

Re: RFR: 8294008: Grapheme implementation of setText() throws IndexOutOfBoundsException [v2]

2022-09-19 Thread Stuart Marks
On Mon, 19 Sep 2022 22:18:42 GMT, Naoto Sato wrote: >> Yeah, I saw there's a mismatch between the src and limit in this call that >> led to the index check Exception: >> 286 for (int b = ci.getBeginIndex(); b < end;) { >> 287 boundaries.add(b); >> 288

Re: RFR: 8294008: Grapheme implementation of setText() throws IndexOutOfBoundsException [v2]

2022-09-19 Thread Naoto Sato
On Mon, 19 Sep 2022 22:07:13 GMT, Joe Wang wrote: >> It's somewhat confusing as this class adapts `CharacterIterator` into >> `CharSequence` which are similar to each other (thus the bug). Those >> `beginIndex`/`endIndex` designate the range in the source >> `CharacterIterator`, and this `leng

Re: RFR: 8294008: Grapheme implementation of setText() throws IndexOutOfBoundsException [v2]

2022-09-19 Thread Naoto Sato
> Fixing JCK failures caused by the new grapheme implementation. The length of > a CharSequence should return the `endIndex`, not `endIndex - beginIndex`. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Added comments to length()

Re: RFR: 8294008: Grapheme implementation of setText() throws IndexOutOfBoundsException

2022-09-19 Thread Joe Wang
On Mon, 19 Sep 2022 21:02:38 GMT, Naoto Sato wrote: >> src/java.base/share/classes/sun/util/locale/provider/BreakIteratorProviderImpl.java >> line 329: >> >>> 327: @Override >>> 328: public int length() { >>> 329: return src.getEndIndex(); >> >> Could the issue be s

Re: RFR: 8294008: Grapheme implementation of setText() throws IndexOutOfBoundsException

2022-09-19 Thread Joe Wang
On Mon, 19 Sep 2022 19:01:57 GMT, Naoto Sato wrote: > Fixing JCK failures caused by the new grapheme implementation. The length of > a CharSequence should return the `endIndex`, not `endIndex - beginIndex`. Marked as reviewed by joehw (Reviewer). - PR: https://git.openjdk.org/jdk/