Re: What is meant by "document context" in JEP 198?

2022-11-24 Thread Alan Bateman
On 25/11/2022 02:04, Ethan McCue wrote: I suppose while I'm asking questions - what exactly are the parts of the JDK making use of ad-hoc json? Maybe we could ship *something* as a jdk.internal module for those use cases? JEP 198 pre-dates records, sealed classes, pattern matching, ... and I

Re: RFR: JDK-8297298 - SequenceInputStream should override transferTo [v2]

2022-11-24 Thread Alan Bateman
On Thu, 24 Nov 2022 20:22:16 GMT, Markus KARG wrote: > Kindly requesting review. :-) The override looks fine. I think [bplb](https://github.com/bplb) plans to review/sponsor it. - PR: https://git.openjdk.org/jdk/pull/11248

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

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:

Integrated: 8297385: Remove duplicated null typos in javadoc

2022-11-24 Thread Dongxu Wang
On Wed, 23 Nov 2022 06:58:09 GMT, Dongxu Wang wrote: > 8297385: Remove duplicated null typos in javadoc This pull request has now been integrated. Changeset: 0ed8b337 Author:Dongxu Wang Committer: Yi Yang URL:

Re: What is meant by "document context" in JEP 198?

2022-11-24 Thread Ethan McCue
I suppose while I'm asking questions - what exactly are the parts of the JDK making use of ad-hoc json? Maybe we could ship *something* as a jdk.internal module for those use cases? On Thu, Nov 24, 2022 at 8:55 PM Ethan McCue wrote: > I'm reading JEP 198 and sketching out what an implementation

What is meant by "document context" in JEP 198?

2022-11-24 Thread Ethan McCue
I'm reading JEP 198 and sketching out what an implementation could look like pursuant to this old conversation. https://mail.openjdk.org/pipermail/discuss/2020-April/005401.html My biggest question right now is what does the JEP mean exactly by "document context" - Parsing APIs which allow

Re: What are the policies for internal modules?

2022-11-24 Thread Ethan McCue
(always so hard to remember to reply all) On Thu, Nov 24, 2022 at 8:26 PM Ethan McCue wrote: > The use here is giving help to the user on > misspelled classes/methods/fields like "new ArayList". > > For now we've just copy pasted the class since that seems the least > architecturally painful.

Re: RFR: JDK-8297298 - SequenceInputStream should override transferTo [v2]

2022-11-24 Thread Markus KARG
On Sun, 20 Nov 2022 09:41:47 GMT, Markus KARG wrote: >> Since JDK 18 some implementations of InputStream.transferTo, namely >> FileInputStream and ChannelInputStream, offload work to lower layers using >> NIO channels. This provides shorter execution time and reduced resource >> consumption.

Re: RFR: 8297530: java.lang.IllegalArgumentException: Negative length on strings concatenation [v2]

2022-11-24 Thread Claes Redestad
On Thu, 24 Nov 2022 17:50:42 GMT, Andrey Turbanov wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Require 64-bit arch to avoid (most) hypothetical false positives > >

Re: RFR: 8297530: java.lang.IllegalArgumentException: Negative length on strings concatenation [v2]

2022-11-24 Thread Andrey Turbanov
On Thu, 24 Nov 2022 15:01:12 GMT, Claes Redestad wrote: >> When concatenating Strings, OutOfMemoryError should be thrown on all >> overflow conditions. This fixes a case that erroneously thro IAE on >> concatenations of long (`length > Integer.MAX_VALUE/2`) UTF16 strings due >> failing to

Integrated: 8297530: java.lang.IllegalArgumentException: Negative length on strings concatenation

2022-11-24 Thread Claes Redestad
On Thu, 24 Nov 2022 13:23:13 GMT, Claes Redestad wrote: > When concatenating Strings, OutOfMemoryError should be thrown on all overflow > conditions. This fixes a case that erroneously thro IAE on concatenations of > long (`length > Integer.MAX_VALUE/2`) UTF16 strings due failing to check for

Integrated: 8297150: Add a @sealedGraph tag to Reference

2022-11-24 Thread Per Minborg
On Wed, 16 Nov 2022 16:52:50 GMT, Per Minborg wrote: > This PR proposes to opt in for graphic rendering of the sealed hierarchy of > the `Reference` class. > > Rendering capability was added via https://bugs.openjdk.org/browse/JDK-8295653 > > Here is how it would look like: > >

Re: RFR: 8297150: Add a @sealedGraph tag to Reference

2022-11-24 Thread Alan Bateman
On Wed, 16 Nov 2022 16:52:50 GMT, Per Minborg wrote: > This PR proposes to opt in for graphic rendering of the sealed hierarchy of > the `Reference` class. > > Rendering capability was added via https://bugs.openjdk.org/browse/JDK-8295653 > > Here is how it would look like: > >

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: 8297530: java.lang.IllegalArgumentException: Negative length on strings concatenation [v2]

2022-11-24 Thread Alan Bateman
On Thu, 24 Nov 2022 15:01:12 GMT, Claes Redestad wrote: >> When concatenating Strings, OutOfMemoryError should be thrown on all >> overflow conditions. This fixes a case that erroneously thro IAE on >> concatenations of long (`length > Integer.MAX_VALUE/2`) UTF16 strings due >> failing to

Re: RFR: 8297530: java.lang.IllegalArgumentException: Negative length on strings concatenation [v2]

2022-11-24 Thread Claes Redestad
On Thu, 24 Nov 2022 14:14:56 GMT, Alan Bateman wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Require 64-bit arch to avoid (most) hypothetical false positives > >

Re: RFR: 8297530: java.lang.IllegalArgumentException: Negative length on strings concatenation [v2]

2022-11-24 Thread Claes Redestad
> When concatenating Strings, OutOfMemoryError should be thrown on all overflow > conditions. This fixes a case that erroneously thro IAE on concatenations of > long (`length > Integer.MAX_VALUE/2`) UTF16 strings due failing to check for > overflow after shifting index left with the coder. > >

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

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: 8297530: java.lang.IllegalArgumentException: Negative length on strings concatenation

2022-11-24 Thread Alan Bateman
On Thu, 24 Nov 2022 13:23:13 GMT, Claes Redestad wrote: > When concatenating Strings, OutOfMemoryError should be thrown on all overflow > conditions. This fixes a case that erroneously thro IAE on concatenations of > long (`length > Integer.MAX_VALUE/2`) UTF16 strings due failing to check for

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v33]

2022-11-24 Thread Andrew Haley
> JEP 429 implementation. Andrew Haley has updated the pull request incrementally with one additional commit since the last revision: Unused variable - Changes: - all: https://git.openjdk.org/jdk/pull/10952/files - new:

Re: RFR: 8297530: java.lang.IllegalArgumentException: Negative length on strings concatenation

2022-11-24 Thread Evgeny Nikitin
On Thu, 24 Nov 2022 13:23:13 GMT, Claes Redestad wrote: > When concatenating Strings, OutOfMemoryError should be thrown on all overflow > conditions. This fixes a case that erroneously thro IAE on concatenations of > long (`length > Integer.MAX_VALUE/2`) UTF16 strings due failing to check for

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v31]

2022-11-24 Thread Jim Laskey
> Enhance the Java programming language with string templates, which are > similar to string literals but contain embedded expressions. A string > template is interpreted at run time by replacing each expression with the > result of evaluating that expression, possibly after further validation

RFR: 8297530: java.lang.IllegalArgumentException: Negative length on strings concatenation

2022-11-24 Thread Claes Redestad
When concatenating Strings, OutOfMemoryError should be thrown on all overflow conditions. This fixes a case that erroneously thro IAE on concatenations of long (`length > Integer.MAX_VALUE/2`) UTF16 strings due failing to check for overflow after shifting index left with the coder. This was

Re: RFR: 8297286: runtime/vthread tests crashing after JDK-8296324 [v2]

2022-11-24 Thread Serguei Spitsyn
On Wed, 23 Nov 2022 10:14:23 GMT, Serguei Spitsyn wrote: >> This problem has two sides. >> One is that the `VirtualThread::run() `cashes the field `notifyJvmtiEvents` >> value. >> It caused the native method `notifyJvmtiUnmountBegin()` not called after the >> field `notifyJvmtiEvents` >> value

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

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

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.

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: } >>

Re: RFR: 8297286: runtime/vthread tests crashing after JDK-8296324 [v2]

2022-11-24 Thread Alan Bateman
On Wed, 23 Nov 2022 10:14:23 GMT, Serguei Spitsyn wrote: >> This problem has two sides. >> One is that the `VirtualThread::run() `cashes the field `notifyJvmtiEvents` >> value. >> It caused the native method `notifyJvmtiUnmountBegin()` not called after the >> field `notifyJvmtiEvents` >> value

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

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: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v32]

2022-11-24 Thread Andrew Haley
> JEP 429 implementation. Andrew Haley has updated the pull request incrementally with one additional commit since the last revision: Cleanup - Changes: - all: https://git.openjdk.org/jdk/pull/10952/files - new: https://git.openjdk.org/jdk/pull/10952/files/903780d6..1b3c39bc

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

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v31]

2022-11-24 Thread Andrew Haley
> JEP 429 implementation. Andrew Haley has updated the pull request incrementally with one additional commit since the last revision: Cleanup - Changes: - all: https://git.openjdk.org/jdk/pull/10952/files - new: https://git.openjdk.org/jdk/pull/10952/files/15db2a30..903780d6

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v30]

2022-11-24 Thread Andrew Haley
> JEP 429 implementation. Andrew Haley has updated the pull request incrementally with five additional commits since the last revision: - Merge branch 'JDK-828' of https://github.com/theRealAph/jdk into JDK-828 - Update

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v29]

2022-11-24 Thread Andrew Haley
> JEP 429 implementation. Andrew Haley has updated the pull request incrementally with one additional commit since the last revision: Update src/jdk.incubator.concurrent/share/classes/jdk/incubator/concurrent/ScopedValue.java Co-authored-by: Paul Sandoz - Changes: -

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v25]

2022-11-24 Thread Andrew Haley
On Wed, 23 Nov 2022 18:47:28 GMT, Paul Sandoz wrote: >> Andrew Haley has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 52 commits: >> >> - Merge master >> - javadoc >> - Feedback from reviewers >> - Update

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v28]

2022-11-24 Thread Andrew Haley
> JEP 429 implementation. Andrew Haley has updated the pull request incrementally with one additional commit since the last revision: Reviewer feedback - Changes: - all: https://git.openjdk.org/jdk/pull/10952/files - new:

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v27]

2022-11-24 Thread Andrew Haley
> JEP 429 implementation. Andrew Haley has updated the pull request incrementally with two additional commits since the last revision: - Merge branch 'JDK-828' of https://github.com/theRealAph/jdk into JDK-828 - Fix merge - Changes: - all:

RFR: 8297561: Redundant index check in String.offsetByCodePoints()

2022-11-24 Thread Sergey Tsypanov
`String.offsetByCodePoints()` delegates to `Character.offsetByCodePoints()` which in turn specifies the same exception thrown under the same conditions and the implementation does exactly the same checks. This means we can remove the check from `String.offsetByCodePoints()` and rely on the one

Re: RFR: 8290313: Produce warning when user specified java.io.tmpdir directory doesn't exist [v2]

2022-11-24 Thread Sean Coffey
On Wed, 16 Nov 2022 15:12:41 GMT, Roger Riggs wrote: >> Weibing Xiao has updated the pull request incrementally with one additional >> commit since the last revision: >> >> the change according to review comment > > test/jdk/java/io/File/TempDirectoryNotExisting.java line 45: > >> 43: >>

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v25]

2022-11-24 Thread Andrew Haley
On Wed, 23 Nov 2022 18:49:07 GMT, Paul Sandoz wrote: >> Andrew Haley has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 52 commits: >> >> - Merge master >> - javadoc >> - Feedback from reviewers >> - Update

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v25]

2022-11-24 Thread Andrew Haley
On Wed, 23 Nov 2022 19:16:23 GMT, Paul Sandoz wrote: > Looks good (just some last minor comments). I did not focus on the tests, nor > too closely at all of the HotSpot changes. > > Something for future investigation perhaps (if not already thought about): > consider using a persistent map, a

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v26]

2022-11-24 Thread Andrew Haley
> JEP 429 implementation. Andrew Haley has updated the pull request incrementally with two additional commits since the last revision: - Update src/jdk.incubator.concurrent/share/classes/jdk/incubator/concurrent/ScopedValue.java Co-authored-by: Paul Sandoz - Update