RFR: JDK-8292060: Make ClassFileVersionTest.java version adapting

Harold Seigel hseigel at openjdk.org
Tue Aug 9 17:20:27 UTC 2022


On Mon, 8 Aug 2022 19:30:22 GMT, Joe Darcy <darcy at openjdk.org> wrote:

> 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()

Changes look good.  Thanks!

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

Marked as reviewed by hseigel (Reviewer).

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


More information about the hotspot-runtime-dev mailing list