RFR: 8291360: Create entry points to expose low-level class file information

Harold Seigel hseigel at openjdk.org
Fri Jul 29 19:56:51 UTC 2022


On Fri, 29 Jul 2022 18:12:22 GMT, Joe Darcy <darcy at openjdk.org> wrote:

>> Please review this change to fix JDK-8291360.  This fix adds entry points getClassFileVersion() and getClassAccessFlagsRaw() to class java.lang.Class.  The new entry points return the current class's class file version and its raw access flags.
>> 
>> The fix was tested by running Mach5 tiers 1-2 on Linux, Mac OS, and Windows, and Mach5 tiers 1-3 on Linux x64.  Additionally, the JCK lang, vm, and api tests and new regression tests were run locally on Linux x64.
>> 
>> Thanks, Harold
>
> src/java.base/share/classes/java/lang/Class.java line 4700:
> 
>> 4698:      * returned.  If the class is a primitive then ACC_ABSTRACT | ACC_FINAL | ACC_PUBLIC.
>> 4699:      */
>> 4700:     private int getClassAccessFlagsRaw() {
> 
> For a "raw" method, it might be better to return the flags on the array class object itself rather than loop down to the component type.

There's no bytecode stream for arrays.  It's created using anewarray with a dimension operand and a cp pointer to the component type.  So there are no flags for the array object.

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

PR: https://git.openjdk.org/jdk/pull/9688



More information about the build-dev mailing list