RFR: 8297271: AccessFlags should be specific to class file version [v2]
Roger Riggs
rriggs at openjdk.org
Wed Dec 7 21:38:09 UTC 2022
On Wed, 7 Dec 2022 20:17:57 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> Should the masking out unassigned bits that is done in this method be extended to the existing `AccessFlag.maskToAccessFlags(mask, location)`; Instead of throwing `IllegalArgumentException`?
>> The two methods should be consistent in this regard and build their return values on the meta-data in each AccessFlag.
>
>> Should the masking out unassigned bits that is done in this method be extended to the existing `AccessFlag.maskToAccessFlags(mask, location)`; Instead of throwing `IllegalArgumentException`? The two methods should be consistent in this regard and build their return values on the meta-data in each AccessFlag.
>
> My prior comment
>
> "The difference in exception handling behavior compared to the method w/o a ClassFileFormatVersion argument should at least be discussed."
>
> was calling attention to the differing strict vs lax handling of unexpected bits in the two overloaded methods. If the policies are not the same, there should at least be prominent text nothing and explaining the difference.
I think both methods should have the same behavior, both should ignore unassigned mask bits.
The means removing the @throws from the existing method and repeating the text from the new method.
An @apiNote would give it more visibility than the current simple sentence in the method javadoc.
-------------
PR: https://git.openjdk.org/jdk/pull/11399
More information about the core-libs-dev
mailing list