Integrated: 8296329: jar validator doesn't account for minor class file version

2022-11-22 Thread Bo Zhang
On Tue, 15 Nov 2022 01:52:14 GMT, Bo Zhang  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.

This pull request has now been integrated.

Changeset: faf48e61
Author:Bo Zhang 
Committer: Jorn Vernee 
URL:   
https://git.openjdk.org/jdk/commit/faf48e61be4f97f725b053aa351d3c64638546bf
Stats: 127 lines in 3 files changed: 123 ins; 1 del; 3 mod

8296329: jar validator doesn't account for minor class file version

Reviewed-by: jvernee

-

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


Re: RFR: 8296329: jar validator doesn't account for minor class file version [v2]

2022-11-22 Thread Bo Zhang
On Wed, 23 Nov 2022 03:01:51 GMT, Jorn Vernee  wrote:

>> @JornVernee  can you please sponsor this PR?
>
> @blindpirate Yes. If you `/integrate` it, I can then `/sponsor`.

Thanks @JornVernee !

-

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


Re: RFR: 8296329: jar validator doesn't account for minor class file version [v2]

2022-11-22 Thread Bo Zhang
On Wed, 16 Nov 2022 13:23:03 GMT, Jorn Vernee  wrote:

>> Bo Zhang has refreshed the contents of this pull request, and previous 
>> commits have been removed. The incremental views will show differences 
>> compared to the previous content of the PR. The pull request contains one 
>> new commit since the last revision:
>> 
>>   8296329: Only compare major versions in jar validator
>
> Marked as reviewed by jvernee (Reviewer).

@JornVernee  can you please sponsor this PR?

-

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


Re: RFR: 8296329: jar validator doesn't account for minor class file version [v2]

2022-11-15 Thread Bo Zhang
On Tue, 15 Nov 2022 02:14:46 GMT, Jorn Vernee  wrote:

>> Bo Zhang has refreshed the contents of this pull request, and previous 
>> commits have been removed. The incremental views will show differences 
>> compared to the previous content of the PR. The pull request contains one 
>> new commit since the last revision:
>> 
>>   8296329: Only compare major versions in jar validator
>
> test/jdk/tools/jar/multiRelease/VersionValidatorTest.java line 116:
> 
> 
> My concern with this is that this will need to be updated after each release. 
> Looks like there are also ways to directly alter the minor version of a class 
> file, and I recommend doing that instead. See: 
> https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java#L51
> 
> Also, there's one more negative case missing where the base version uses 20 + 
> preview features, and the other version is 19.

Thanks @JornVernee . I have updated the test, PTAL!

> Please assign the JBS ticket to yourself as well.

Sorry, I don't have permission to update JBS ticket.

-

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


Re: RFR: 8296329: jar validator doesn't account for minor class file version [v2]

2022-11-15 Thread Bo Zhang
> 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.

Bo Zhang has refreshed the contents of this pull request, and previous commits 
have been removed. The incremental views will show differences compared to the 
previous content of the PR. The pull request contains one new commit since the 
last revision:

  8296329: Only compare major versions in jar validator

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/11153/files
  - new: https://git.openjdk.org/jdk/pull/11153/files/93ec7fb8..b293cbfe

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=11153=01
 - incr: https://webrevs.openjdk.org/?repo=jdk=11153=00-01

  Stats: 30 lines in 1 file changed: 13 ins; 4 del; 13 mod
  Patch: https://git.openjdk.org/jdk/pull/11153.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11153/head:pull/11153

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


RFR: 8296329: Only compare major versions in jar validator

2022-11-14 Thread Bo Zhang
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.

-

Commit messages:
 - 8296329: Only compare major versions in jar validator

Changes: https://git.openjdk.org/jdk/pull/11153/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk=11153=00
  Issue: https://bugs.openjdk.org/browse/JDK-8296329
  Stats: 118 lines in 3 files changed: 114 ins; 1 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/11153.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11153/head:pull/11153

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