On Thu, 17 Jun 2021 10:19:43 GMT, Alan Bateman <al...@openjdk.org> wrote:
>> Yi Yang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> restore IndexOfOufBoundsException; split exception line > > src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 471: > >> 469: */ >> 470: public int offsetByCodePoints(int index, int codePointOffset) { >> 471: checkOffset(index, count); > > String.offsetByCodePoints is specified to throw IOOBE. checkOffset may throw > the more specific StringIndexOutOfBoundsException. That's a compatible change > but I worry that we might want to throw the less specific exception in the > future. I only mention it because there have been cases in java.lang where > IOOBE was specified and AIOOBE by the implementation and it has been > problematic to touch the implementation as a result. Yes, changing the type of thrown exception may break something. And as David said, this also requires a CSR approval, which is a relatively long process, so I restored the original code. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507