On Fri, 31 Jul 2026 04:06:23 GMT, Chen Liang <[email protected]> wrote:
>> src/java.base/share/classes/java/lang/Class.java line 907:
>>
>>> 905:
>>> 906: /**
>>> 907: * Determines if this {@code Class} object represents a class or
>>> an interface.
>>
>> Are hidden classes intended to be classes-or-interfaces under this method?
>>
>> Trying to tease apart if the goal is an "is-declared-type" predicate or an
>> "is-class-or-interface" predicate. Those two might only diff on hidden
>> classes.
>
> Yes, there are hidden classes and interfaces. They are derived from class
> files, and they can declare methods and fields, even though other class files
> cannot link against them. In fact, my unit tests have cases where I test
> against hidden classes.
Okay; I recommend the portion of the java.lang.Class spec discussion hidden
classes up at the class-level be updated to explicitly state hidden class have
is-class-or-interface as true.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/32109#discussion_r3687995402