On Tue, 11 Feb 2025 20:56:39 GMT, Coleen Phillimore <[email protected]> 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/java/lang/Class.java line 807:
> 805: */
> 806: public boolean isArray() {
> 807: return componentType != null;
The componentType declaration should have a comment indicating that == null is
the sole indication that the class is an interface.
Perhaps there should be an assert somewhere validating/cross checking that
requirement.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23572#discussion_r1961869286