Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread Alan Bateman
On Fri, 25 Nov 2022 06:46:52 GMT, ExE Boss wrote: > I believe `UnsupportedOperationException` would be better for this. It would but Per is right that this it is throwing ISE today, it's just that the PR adds an explicit check and that highlights that the wrong exception is thrown. Buffers tha

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread ExE Boss
On Thu, 24 Nov 2022 14:56:07 GMT, Per Minborg wrote: >> src/java.base/share/classes/sun/nio/ch/IOUtil.java line 480: >> >>> 478: static MemorySessionImpl acquireScope(ByteBuffer bb, boolean >>> async) { >>> 479: if (async && NIO_ACCESS.isThreadConfined(bb)) { >>> 480: th

Re: RFR: 8294526: sun/security/provider/SubjectCodeSource.java no longer referenced [v3]

2022-11-24 Thread Xue-Lei Andrew Fan
On Thu, 24 Nov 2022 09:02:51 GMT, Ryan Wallace wrote: >> SubjectCodeSource is no longer used, Class should be deleted and all >> references updated > > Ryan Wallace has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev excludes the unrelated ch

Re: RFR: 8297519: Improve expressions and modernise code

2022-11-24 Thread Andrey Turbanov
On Thu, 24 Nov 2022 08:24:37 GMT, Per Minborg wrote: > During the work of another PR (https://github.com/openjdk/jdk/pull/11260), > several improvement areas were identified. These are now adressed in this > separate PR proposing the use of more modern Java constructs as well as > simplifying

Re: RFR: 8288050: Add support of SHA-512/224 and SHA-512/256 to the PBKDF2 and PBES2 impls in SunJCE provider

2022-11-24 Thread Andrey Turbanov
On Wed, 23 Nov 2022 23:39:03 GMT, Valerie Peng wrote: > This RFE enhances existing PBE algorithms with the "SHA512/224" and > "SHA512/256" support. > Current transformation parsing in javax.crypto.Cipher class is re-written to > handle the additional "/" in the "SHA512/224" and "SHA512/256" al

Re: RFR: 8297379: Enable the ByteBuffer path of Poly1305 optimizations

2022-11-24 Thread Jatin Bhateja
On Wed, 23 Nov 2022 23:33:32 GMT, Volodymyr Paprotski wrote: > Regarding mainline: > - I decided not to 'unroll' the top while loop (i.e. `engineUpdate(byte[] > input, int offset, int len)` is unrolled) >- It is debatable which version is easier to understand. If this version > is 'too comp

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v14]

2022-11-24 Thread Per Minborg
> This PR proposes the introduction of **guarding** of the use of > `DirectBuffer::address` within the JDK. With the introduction of the Foreign > Function and Memory access, it is possible to derive Buffer instances that > are backed by native memory that, in turn, can be closed asynchronously

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread Per Minborg
On Thu, 24 Nov 2022 12:06:44 GMT, Alan Bateman wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove redundant method > > src/java.base/share/classes/sun/nio/ch/IOUtil.java line 480: > >> 478: static MemorySes

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread Per Minborg
On Thu, 24 Nov 2022 11:58:12 GMT, Maurizio Cimadamore wrote: >> Separately, also (optional) stylistic: the indenting on this and following >> class is a bit odd. There is a certain tendency to compress lines - e.g. to >> reach for one-liners, when in reality the body is not that trivial. If I

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread Alan Bateman
On Thu, 24 Nov 2022 11:42:52 GMT, Per Minborg wrote: >> This PR proposes the introduction of **guarding** of the use of >> `DirectBuffer::address` within the JDK. With the introduction of the Foreign >> Function and Memory access, it is possible to derive Buffer instances that >> are backed by

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread Maurizio Cimadamore
On Thu, 24 Nov 2022 11:54:43 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove redundant method > > src/java.base/share/classes/sun/nio/ch/IOUtil.java line 519: > >> 517: } >> 518

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread Maurizio Cimadamore
On Thu, 24 Nov 2022 11:57:33 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/sun/nio/ch/IOUtil.java line 519: >> >>> 517: } >>> 518: >>> 519: record LinkedRunnable(Runnable node, Runnable next) >> >> Some (optional) style comments: I'm not sure this is a record. E.g. bo

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread Maurizio Cimadamore
On Thu, 24 Nov 2022 11:42:52 GMT, Per Minborg wrote: >> This PR proposes the introduction of **guarding** of the use of >> `DirectBuffer::address` within the JDK. With the introduction of the Foreign >> Function and Memory access, it is possible to derive Buffer instances that >> are backed by

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread Maurizio Cimadamore
On Thu, 24 Nov 2022 11:42:52 GMT, Per Minborg wrote: >> This PR proposes the introduction of **guarding** of the use of >> `DirectBuffer::address` within the JDK. With the introduction of the Foreign >> Function and Memory access, it is possible to derive Buffer instances that >> are backed by

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread Per Minborg
> This PR proposes the introduction of **guarding** of the use of > `DirectBuffer::address` within the JDK. With the introduction of the Foreign > Function and Memory access, it is possible to derive Buffer instances that > are backed by native memory that, in turn, can be closed asynchronously

Re: RFR: 8296546: Add @spec tags to API [v3]

2022-11-24 Thread Alan Bateman
On Wed, 23 Nov 2022 18:57:03 GMT, Jonathan Gibbons wrote: >> Please review a "somewhat automated" change to insert `@spec` tags into doc >> comments, as appropriate, to leverage the recent new javadoc feature to >> generate a new page listing the references to all external specifications >> li

Re: RFR: 8294526: sun/security/provider/SubjectCodeSource.java no longer referenced [v2]

2022-11-24 Thread Ryan Wallace
On Fri, 18 Nov 2022 17:49:45 GMT, Xue-Lei Andrew Fan wrote: >> @XueleiFan I have removed the Test and related policy files >> (Comparator.Combined.Policy/ >> Comparator.Comparator.Policy/Comparator.Principal.Policy), is this what you >> were expecting? I can confirm I am still getting a success

Re: RFR: 8294526: sun/security/provider/SubjectCodeSource.java no longer referenced [v3]

2022-11-24 Thread Ryan Wallace
> SubjectCodeSource is no longer used, Class should be deleted and all > references updated Ryan Wallace has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contain

Re: RFR: 8297519: Improve expressions and modernise code

2022-11-24 Thread Per Minborg
On Thu, 24 Nov 2022 08:24:37 GMT, Per Minborg wrote: > During the work of another PR (https://github.com/openjdk/jdk/pull/11260), > several improvement areas were identified. These are now adressed in this > separate PR proposing the use of more modern Java constructs as well as > simplifying

RFR: 8297519: Improve expressions and modernise code

2022-11-24 Thread Per Minborg
During the work of another PR (https://github.com/openjdk/jdk/pull/11260), several improvement areas were identified. These are now adressed in this separate PR proposing the use of more modern Java constructs as well as simplifying a large number of logical expressions that were previously non

Re: RFR: 8297519: Improve expressions and modernise code

2022-11-24 Thread Per Minborg
On Thu, 24 Nov 2022 08:24:37 GMT, Per Minborg wrote: > During the work of another PR (https://github.com/openjdk/jdk/pull/11260), > several improvement areas were identified. These are now adressed in this > separate PR proposing the use of more modern Java constructs as well as > simplifying

RFR: 8297515: serialVersionUID fields are not annotated with @Serial

2022-11-24 Thread Per Minborg
This PR proposes adding `@Serial` annotations to certain fields participating in serialisation. - Commit messages: - Annotate serailzation fields with @Serial Changes: https://git.openjdk.org/jdk/pull/11347/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11347&range=00 Is

RFR: 8297505: Declare fields in some sun.security.pkcs11 classes as final

2022-11-24 Thread Per Minborg
This PR proposes declaring some fields as `final` to potentially unlock performance optimisations and improve thread visibility (e.g. for GC threads). The PR also fixes a "synchronising on a non-final field" anti-pattern. - Commit messages: - Declare fields and classes final Chang