On Mon, 28 Nov 2022 22:56:27 GMT, Roger Riggs <rri...@openjdk.org> wrote:

> The accessFlags() methods added (in JDK 20, the current release) to 
> java.lang.Class, java.lang.reflect.Executable, and java.lang.reflect.Field 
> assume the access flags are from the current/most recent class file format 
> version. For current and past class file format versions there are few 
> significant variations but future changes are anticipated that change the 
> meaning of some access flag mask bits.
> 
> The accessFlags() methods are clarified to return the access flags that are 
> applicable to the class file format version of the class. The existing 
> AccessFlag.Locations API already contains information about the locations 
> that are applicable to a class file format version. That information should 
> be used to construct the set of AccessFlags returned. A method is added to 
> AccessFlag that returns the applicable flags for a particular mask, Location, 
> and class file format version:

Yes, the location information via 
`AccessFlags.locations(ClassFileFormatVersion)` provides the needed information.
And the tests verify that information.
My objective was to make the AccessFlags returned for a class reflect the class 
file format version number of the underlying class.  Currently, it is 
implicitly the current class file format version supported by the VM, not 
necessarily the version of the class loaded.
Suggestions welcome for how that is exposed in the APIs and implemented.

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

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

Reply via email to