On Fri, 18 Feb 2022 14:53:42 GMT, Roger Riggs <rri...@openjdk.org> wrote:

> The Location enum does give more control over the places modifiers can occur 
> and be extended as needed. But its unfortunate there's no (simple/obvious) 
> mapping to the other concepts of the corresponding types, such as ElementType 
> or Class/Method/Constructor. I don't have a clear use case for the mapping, 
> so maybe its just a rough edge that can be smoothed out when AccessFlags gets 
> used.

A near-future iteration of this work will include functionality to map from an 
integer to a set of access flags. Since there are flags with the same mask 
position, such as volatile and bridge, some location context is needed to know 
which mapping

0x0000_0040 -> BRIDGE
0x0000_0040 -> VOLATILE

is correct and desired in context.

The Location enum could include a condensed primer on how Java programs get 
compiled into class files (constructors are just weird static methods to the 
VM!), but I didn't think that was necessary for the initial version and the 
included comment "<em>Just stub-out constant descriptions for now</em>." was 
meant to imply more detailed discussion would be forthcoming.

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

PR: https://git.openjdk.java.net/jdk/pull/7445

Reply via email to