RFR: 8338544: Dedicated Array class descriptor implementation [v3]
Chen Liang
liach at openjdk.org
Fri Oct 11 14:48:47 UTC 2024
On Tue, 8 Oct 2024 21:13:47 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> So like `if (rank <= 0) throw ConstantUtils.rankNotPositive(rank);` at individual use sites?
>
> I meant no need to have a utility method. Just do this:
>
> Suggestion:
>
> public static void validateArrayDepth(int rank) {
> if (rank <= 0) {
> throw new IllegalArgumentException("rank " + rank + " is not a positive value");
> }
> validateMaxArrayDepth(rank, true);
> }
>
>
> Same change in `ArrayClassDescImpl::arrayType(int)`
Done. The negative rank check is pulled out separately in `ArrayClassDescImpl::arrayType(int)`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20665#discussion_r1797064156
More information about the core-libs-dev
mailing list