RFR: JDK-8295071: Spec Clarification : ClassFileFormatVersion: System property java.class.version | Java class format version number [v3]

Iris Clark iris at openjdk.org
Mon Jun 5 21:42:56 UTC 2023


On Mon, 5 Jun 2023 21:34:04 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> Update PR and CSR to use the wording:
>> 
>> "Latest Java class file format version recognized by the Java runtime as "MAJOR.MINOR" where MAJOR and MINOR are both formatted as decimal integers"
>> 
>> While it wouldn't be unreasonable to assume that when running under --enable-preview that the minor version was 65535, it is printed out as 0 with or without preview being enabled.
>> 
>> I didn't want to broach preview-ness as part of this update to either promise or document the current behavior.
>
> Related to Alan's comment on RELEASE_xxx in ClassFileFormatVersion, perhaps the class description can clarify that a class file version has major version number `M` and minor version number `m` and a Java Virtual Machine implementation can support a class file format of version v if and only if v lies in some contiguous range Mi.0 ≤ v ≤ Mj.m.   RELEASE_xxx represents the major version number. 
> 
> That way, the description of RELEASE_xxx can remain to say "The version recognized...".

The decimal integer should be unsigned and without leading zeros.  A regex similar to that provided by Runtime.Version would make things clear.  I think that Mandy's suggestion would be a reasonable alternative as the Java class file version number isn't truly arbitrary.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14305#discussion_r1218623501


More information about the core-libs-dev mailing list