RFR: 8364187: Make getClassAccessFlagsRaw non-native [v2]

Coleen Phillimore coleenp at openjdk.org
Tue Jul 29 19:58:11 UTC 2025


On Tue, 29 Jul 2025 15:22:53 GMT, Chen Liang <liach at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/Class.java line 248:
>> 
>>> 246:         protectionDomain = pd;
>>> 247:         primitive = isPrim;
>>> 248:         classFileAccessFlags = flags;
>> 
>> Its not that hard to add a field, why not have done this for identity?
>
> Fields are initialized by injection in javaClasses instead of through this constructor, so it's easy for us to accidentally forget to inject a field.

For IDENTITY, I didn't have to inject that one because the Java code knew when to set it, not the JVM code reading the data out of the classfile.  And the logic belongs in the Java code, not the JVM. This one comes from the classfile, there isn't another way to get the information to the java.lang.Class.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26517#discussion_r2240783242


More information about the core-libs-dev mailing list