On Tue, 15 Nov 2022 01:52:14 GMT, Bo Zhang <d...@openjdk.org> wrote: > As described in [JDK-8296329](https://bugs.openjdk.org/browse/JDK-8296329), > previously, the jar validator compare the "version" to validate a > multi-release jar. The "version" is a mix of the major and minor version > fused into a single int, which might be a negative number with > `--enable-preview` - this result in wrong comparison. > > This PR fixes it by only comparing major versions.
See also JDK-8296119. I don't know how common it will be for someone to publish a MR JAR containing classes compiled to use preview features. It would be a bit inconvenient for users as they would need to know to run with --enable-preview on some releases. This shouldn't impact the API compatibility checking that the jar tool does so dropping the minor version and just checking the major version might be okay. ------------- PR: https://git.openjdk.org/jdk/pull/11153