On Sat, 17 May 2025 02:15:42 GMT, Chen Liang <li...@openjdk.org> wrote:

> `isArray` and null return is now redundant when `componentType` is changed to 
> an explicit field.

src/java.base/share/classes/java/lang/Class.java line 3985:

> 3983:     @Override
> 3984:     public Class<?> componentType() {
> 3985:         return componentType;

Did you consider calling getComponentType(), which already returns the field?

Are there regression tests for Class::componentType()/Class::getComponentType() 
somewhere? I didn't see them in the obvious test/jdk/java/lang/Class directory.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25280#discussion_r2094593495

Reply via email to