On Thu, 17 Feb 2022 02:56:53 GMT, Joe Darcy <da...@openjdk.org> wrote:
>> Make explicit illegal argument cases of Class.arrayType. >> >> Please also review the corresponding CSR: >> https://bugs.openjdk.java.net/browse/JDK-8268300 > > Joe Darcy has updated the pull request with a new target base due to a merge > or a rebase. The incremental webrev excludes the unrelated changes brought in > by the merge/rebase. The pull request contains six additional commits since > the last revision: > > - Revisit and update fix to address review feedback. > - Merge branch 'master' into 8268250 > - Add missing ending newline. > - Add test file. > - Merge branch 'master' into 8268250 > - 8268250: Class.arrayType() for a 255-d array throws undocumented > IllegalArgumentException Reviving this request, I looked over the exception types defined in java.lang and if IllegalArgumentException is not used, UnsupportedOperationException seems to me to be the most appropriate alternative. This is a small behavioral change from the current (undocumented) behavior of throwing IllegalArgumentException, but I don't estimate the cases in question are common in practice. ------------- PR: https://git.openjdk.java.net/jdk/pull/4382