RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v2]
Coleen Phillimore
coleenp at openjdk.org
Wed Feb 19 18:40:37 UTC 2025
On Wed, 19 Feb 2025 17:10:09 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> It was. Before the componentType field was reused for the class initialization monitor int array, and it caused problems with core reflection if a program reflectively accesses this field after a few hundred times. See [JDK-8337622](https://bugs.openjdk.org/browse/JDK-8337622).
>
> Yes, this comment is obsolete. We used to share the componentType mirror with an internal 'init-lock' but it caused a bug that was fixed. If it's not an array the componentType is now always null.
So for JDK 8 and 21+, the init_lock and componentType are not shared. In JDK 11 and 17, Hotspot shares the fields, but it's not observable with the older implementation of reflection. See https://bugs.openjdk.org/browse/JDK-8337622.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23572#discussion_r1962189932
More information about the core-libs-dev
mailing list