RFR: 8338544: Dedicated Array class descriptor implementation [v2]
Chen Liang
liach at openjdk.org
Tue Oct 8 19:32:36 UTC 2024
On Tue, 8 Oct 2024 19:16:00 GMT, Chen Liang <liach at openjdk.org> wrote:
>> src/java.base/share/classes/jdk/internal/constant/ArrayClassDescImpl.java line 81:
>>
>>> 79: throw new IllegalStateException(
>>> 80: "Cannot create an array type descriptor with more than "
>>> 81: + MAX_ARRAY_TYPE_DESC_DIMENSIONS + " dimensions");
>>
>> Suggestion:
>>
>> ConstantUtils.validateArrayDepth(rank + 1);
>
> Unfortunately, this has to throw ISE while `validateArrayDepth` throws IAE.
I have extracted this to a new utility method, with a switch on the thrown exception type.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20665#discussion_r1792400368
More information about the core-libs-dev
mailing list