Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion [v2]

2025-07-21 Thread simon
On Mon, 21 Jul 2025 21:24:52 GMT, Chen Liang wrote: >> I mean about the rule the version - similar to isSupportedClassFileVersion >> method > > I still don't think so. I intentionally proposed the original RFE so we have > one place where we can consolidate this handling, and that place should

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion [v2]

2025-07-21 Thread Chen Liang
On Mon, 21 Jul 2025 20:48:12 GMT, simon wrote: >>> Maybe it can be reused in another points? >> >> ClassFileFormatVersion and Optional are more user-oriented classes; internal >> code don't really ever use these two types, so I don't think you need to >> extract this logic specifically. > > I

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion [v2]

2025-07-21 Thread simon
On Mon, 21 Jul 2025 09:00:03 GMT, Mikhail Yankelevich wrote: >> simon has updated the pull request incrementally with two additional commits >> since the last revision: >> >> - 8355652: update copyright year to 2025 in ClassFileVersionImpl.java >> - 8355652: update copyright year to 2025 in

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion [v2]

2025-07-21 Thread simon
> 8355652: add new method to return ClassFileFormatVersion from > ClassFileVersion. > - > ### Progress > - [ ] Change must be properly reviewed (1 review required, with at least 1 > [Reviewer](https://openjdk.org/bylaws#reviewer)) > - [x] Change must not contain extraneous whitespace > -

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion [v2]

2025-07-21 Thread simon
On Mon, 21 Jul 2025 20:44:58 GMT, Chen Liang wrote: >> Got it. Could you have this hook in a private class method or a static >> public method? >> Maybe it can be reused in another points? > >> Maybe it can be reused in another points? > > ClassFileFormatVersion and Optional are more user-orie

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-21 Thread Chen Liang
On Mon, 21 Jul 2025 16:05:59 GMT, simon wrote: > Maybe it can be reused in another points? ClassFileFormatVersion and Optional are more user-oriented classes; internal code don't really ever use these two types, so I don't think you need to extract this logic specifically. - PR R

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-21 Thread simon
On Mon, 21 Jul 2025 02:50:48 GMT, Chen Liang wrote: >> Do you mean something like this? >> >> >> @Override >> public Optional formatVersion() { >> if (majorVersion < 54 || minorVersion != 0) { >> return Optional.empty(); >> } >> try { >> retu

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-21 Thread Mikhail Yankelevich
On Sun, 20 Jul 2025 22:19:07 GMT, simon wrote: > 8355652: add new method to return ClassFileFormatVersion from > ClassFileVersion. > - > ### Progress > - [ ] Change must be properly reviewed (1 review required, with at least 1 > [Reviewer](https://openjdk.org/bylaws#reviewer)) > - [x] C

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-20 Thread Chen Liang
On Mon, 21 Jul 2025 00:32:24 GMT, simon wrote: >> src/java.base/share/classes/jdk/internal/classfile/impl/ClassFileVersionImpl.java >> line 54: >> >>> 52: public Optional formatVersion() { >>> 53: try { >>> 54: return >>> Optional.of(ClassFileFormatVersion.fromMajor(maj

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-20 Thread simon
On Mon, 21 Jul 2025 00:11:20 GMT, Chen Liang wrote: >> 8355652: add new method to return ClassFileFormatVersion from >> ClassFileVersion. >> - >> ### Progress >> - [ ] Change must be properly reviewed (1 review required, with at least 1 >> [Reviewer](https://openjdk.org/bylaws#reviewer)

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-20 Thread Chen Liang
On Sun, 20 Jul 2025 22:19:07 GMT, simon wrote: > 8355652: add new method to return ClassFileFormatVersion from > ClassFileVersion. > - > ### Progress > - [ ] Change must be properly reviewed (1 review required, with at least 1 > [Reviewer](https://openjdk.org/bylaws#reviewer)) > - [x] C

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-20 Thread simon
On Sun, 20 Jul 2025 23:36:53 GMT, Chen Liang wrote: > > I think we should create some unit tests for this API and classes involved. > > Where do you think that is the most appropriate location in the project to > > do it? > > Unit tests for `java.lang.classfile` reside in `test/jdk/jdk/classfi

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-20 Thread Chen Liang
On Sun, 20 Jul 2025 23:30:50 GMT, simon wrote: > I think we should create some unit tests for this API and classes involved. > Where do you think that is the most appropriate location in the project to do > it? Unit tests for `java.lang.classfile` reside in `test/jdk/jdk/classfile`. They can

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-20 Thread simon
On Sun, 20 Jul 2025 22:19:07 GMT, simon wrote: > 8355652: add new method to return ClassFileFormatVersion from > ClassFileVersion. > - > ### Progress > - [ ] Change must be properly reviewed (1 review required, with at least 1 > [Reviewer](https://openjdk.org/bylaws#reviewer)) > - [x] C

RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-20 Thread simon
8355652: add new method to return ClassFileFormatVersion from ClassFileVersion. - ### Progress - [ ] Change must be properly reviewed (1 review required, with at least 1 [Reviewer](https://openjdk.org/bylaws#reviewer)) - [x] Change must not contain extraneous whitespace - [x] Commit messag