JDK-8294008 : Grapheme implementation of setText() throws IndexOutOfBoundsException
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 20
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-09-19
  • Updated: 2022-09-26
  • Resolved: 2022-09-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b16Fixed
Related Reports
Relates :  
Relates :  
Description
Some of the existing JCK tests are failing with IndexOutOfBoundsException
during invocation of setText(StringCharacterIterator).

Noticed that when setText() invoked with the StringCharacterIterator with the 
(https://download.java.net/java/early_access/jdk20/docs/api/java.base/java/text/StringCharacterIterator.html#%3Cinit%3E(java.lang.String,int,int,int)

where 'begin' is > 0 the setText() throws IndexOutOfBoundsException.
But, the values are valid.

Please find the attached code snippet.

sample output is - 
"java.lang.IndexOutOfBoundsException: Range [1, 5) out of bounds for length 4
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
	at "

I see this could be a side effect of JDK-8292387

For more details  on JCK failures - https://bugs.openjdk.org/browse/JCK-7318139

Comments
Changeset: e3358e77 Author: Naoto Sato <naoto@openjdk.org> Date: 2022-09-20 16:46:18 +0000 URL: https://git.openjdk.org/jdk/commit/e3358e77f524f4d448c2ebb7c5afd0aa432f0d44
20-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10349 Date: 2022-09-19 19:01:57 +0000
19-09-2022