On Thu, 23 Jun 2022 14:37:42 GMT, Roger Riggs <rri...@openjdk.org> wrote:

>> Joe Darcy has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Remove implSpec tag from Executable.accessFlags since the class is sealed.
>
> src/java.base/share/classes/java/lang/reflect/AccessFlag.java line 335:
> 
>> 333:             if ((mask &  accessMask) != 0) {
>> 334:                 result.add(accessFlag);
>> 335:                 mask = mask & ~accessMask;
> 
> The removal of the flag from the masks as they are added to set works only if 
> there is a unique mask bit per location.
> (In the future, Valhalla, the same bit mask for more than one AccessFlag can 
> appear in a single Location.)
> Removing flag bits from a copy of the input mask can have the desired effect.

Once the same bit position has multiple purposes for the same construct, there 
will need to be some kind of expansion of the bits -> Set<AccessFlag> API to 
accept more context to make the disambiguation possible.

As part of that future work, I've filed

    JDK-8289106: Add model of class file versions to core reflection

The class file model would be conceptually similar to the 
javax.lang.model.SourceVersion enum.

I'd expect an overload of the maskToAccessFlags method that took a 
ClassFileFormat parameter to drive the disambiguation.

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

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

Reply via email to