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

David Holmes dholmes at openjdk.org
Tue Aug 2 06:41:24 UTC 2022


On Mon, 1 Aug 2022 18:51:10 GMT, Harold Seigel <hseigel 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
>
> Harold Seigel has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Improved tests, added mulit-dimensional array tests, simplified new java.lang.Class API's

src/java.base/share/classes/java/lang/Class.java line 4682:

> 4680:      */
> 4681:     private int getClassFileVersion() {
> 4682:         Class<?> component = isArray() ? elementType() : this;

The variable name `component` seems completely not applicable now. I would just use `c`.

test/hotspot/jtreg/runtime/ClassFile/ClassFileVersionTest.java line 67:

> 65:         if (ver != 64) {
> 66:             int got_minor = (ver >> 16) & 0x0000FFFF;
> 67:             int got_major = ver & 0x0000FFFF;

`got` seems odd in this context as these are not boolean queries.

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

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



More information about the build-dev mailing list