Integrated: JDK-8292060: Make ClassFileVersionTest.java version adapting
Joe Darcy
darcy at openjdk.org
Mon Oct 28 21:00:00 UTC 2024
The goal of this update is to allow ClassFileVersionTest.java to be modified less often while still testing class files of the latest version.
Since the build policy of the JDK is to use the latest source and target, the class files in the java.base module will have the latest major version. By having the test file itself reference a preview API, its class file will have a nonzero minor version. (Simply compiling under "--enable-preview -source ${jdk.version}" is not sufficient to cause the minor version bits to be set.)
As written, the test now only need to be updated when the referenced API goes non-preview as opposed needing to be updated for every feature release.
After JDK-8289106 is fixed, setting latestMajor can be changed to something like
ClassFileFormatVersion.latest().major()
-------------
Commit messages:
- JDK-8292060: Make ClassFileVersionTest.java version adapting
Changes: https://git.openjdk.org/jdk/pull/9796/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9796&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8292060
Stats: 123 lines in 2 files changed: 17 ins; 93 del; 13 mod
Patch: https://git.openjdk.org/jdk/pull/9796.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/9796/head:pull/9796
PR: https://git.openjdk.org/jdk/pull/9796
More information about the hotspot-runtime-dev
mailing list