RFR: 8298033: Character.codePointAt(char[], int, int) doesn't do JavaDoc-specified check [v5]
Sergey Tsypanov
stsypanov at openjdk.org
Wed Dec 7 09:17:16 UTC 2022
On Tue, 6 Dec 2022 16:47:05 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8298033: Fix Character.codePointBefore()
>
> src/java.base/share/classes/java/lang/Character.java line 9480:
>
>> 9478: */
>> 9479: public static int codePointBefore(char[] a, int index, int start) {
>> 9480: if (index <= start || start < 0 || start >= a.length || index > a.length) {
>
> Since `index > start` it is sufficient to throw `index > a.length`.
> The check `start >= a.length` is redundant.
>
> `0 <= start < index <= a.length`
Done. I think we should rename the ticket as soon as we modify two methods now
-------------
PR: https://git.openjdk.org/jdk/pull/11480
More information about the core-libs-dev
mailing list