RFR: 8357178: Simplify Class::componentType
Chen Liang
liach at openjdk.org
Sun May 18 21:17:50 UTC 2025
On Sun, 18 May 2025 18:18:04 GMT, Joe Darcy <darcy at openjdk.org> wrote:
> Did you consider calling getComponentType(), which already returns the field?
I don't think we want an extra indirection here - The logic here is quite simple. Counterargument could be that `MethodType::descriptorString` calls `toMethodDescriptorString`, except these methods involve more complex caching and is not simple like this field access.
> Are there regression tests for Class::componentType()/Class::getComponentType() somewhere? I didn't see them in the obvious test/jdk/java/lang/Class directory.
They are located in `test/jdk/java/lang/constant/TypeDescriptorTest.java`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25280#discussion_r2094628277
More information about the core-libs-dev
mailing list