On Tue, 8 Oct 2024 21:13:47 GMT, Mandy Chung <mch...@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

Reply via email to