On Mon, 15 Jun 2026 15:18:39 GMT, Adam Sotona <[email protected]> wrote:

>> David Simms has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains 2798 commits:
>> 
>>  - Merge remote-tracking branch 'valhalla/lworld' into 
>> jep401_sub_review_8317279
>>  - 8386239: [lworld] Update jdk/java/util/Arrays/ArraysEqCmpTest.java
>>    
>>    Reviewed-by: liach
>>  - 8386242: [lworld] Simplify and clarify StrictProcessor
>>    
>>    Reviewed-by: dsimms
>>  - 8386140: [lworld] FieldReflector using wrong Class argument
>>    
>>    Reviewed-by: alanb, dsimms
>>  - 8386216: [lworld] Rollback meaningless diff in EventClassBuilder
>>    
>>    Reviewed-by: dsimms
>>  - 8385170: [lworld] Serialization spec needs to allow abstract value 
>> classes like Number
>>    
>>    Reviewed-by: liach
>>  - 8385980: [lworld] Standardize pattern for preview value class generation
>>    
>>    Reviewed-by: liach
>>  - 8386086: [lworld] 
>> sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java should be 
>> removed from problem list
>>    
>>    Reviewed-by: liach, dcubed
>>  - Merge
>>    
>>    Merge jdk-28+1
>>  - 8386090: [lworld] Redundant test changes in lworld versus mainline
>>    
>>    Reviewed-by: vromero
>>  - ... and 2788 more: https://git.openjdk.org/jdk/compare/92298786...4d6d2888
>
> src/java.base/share/classes/jdk/internal/classfile/impl/AccessFlagsImpl.java 
> line 62:
> 
>> 60:                 ? null // Try to guess for older preview features
>> 61:                 : VM.isSupportedClassFileVersion(major, minor) ? 
>> ClassFileFormatVersion.fromMajor(major)
>> 62:                                                                : 
>> ClassFileFormatVersion.latest(); // Fallback
> 
> `ClassFileFormatVersion` parsed from a class file appears to be somewhat 
> inconsistent.
> 
> It is set to `null` for all preview class versions, although I assume the 
> intent is for `PreviewAccessFlags` to be used only with the latest major 
> class version.
> 
> Conversely, it is set to `latest()` for clearly unsupported class versions. 
> However, the Class-File API should not attempt to parse unsupported class 
> versions in the first place and should fail instead.

The latest() treatment for unsupported class versions is the existing behavior 
from `AccessFlag.maskToAccessFlags` when we don't pass a 
ClassFileFomratVersion. I think I will make unsupported preview class use 
latest() for consistency.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31123#discussion_r3422175532

Reply via email to