RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

Coleen Phillimore coleenp at openjdk.org
Tue Feb 18 23:49:55 UTC 2025


On Wed, 12 Feb 2025 00:05:13 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Class.isInterface() can check modifier flags, Class.isArray() can check whether component mirror is non-null and Class.isPrimitive() needs a new final transient boolean in java.lang.Class that the JVM code initializes.
>> Tested with tier1-4 and performance tests.
>
> src/java.base/share/classes/jdk/internal/reflect/Reflection.java line 59:
> 
>> 57:             Reflection.class, ALL_MEMBERS,
>> 58:             AccessibleObject.class, ALL_MEMBERS,
>> 59:             Class.class, Set.of("classLoader", "classData", "modifiers", "isPrimitive"),
> 
> I think the field is named `isPrimitive`, right?

The method is isPrimitive so I think I had to give the field isPrimitiveType as a name, so this is wrong.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23572#discussion_r1952521536


More information about the core-libs-dev mailing list