Re: RFR: 8331876: JFR: Move file read and write events to java.base [v3]

2024-05-21 Thread Stuart Marks
On Fri, 17 May 2024 09:26:03 GMT, Alan Bateman wrote: >> My main concern here is the addition of clutter (checking two flags, and >> creating two levels of nested "impl" methods) at every call site. We may >> need to rearrange our internal API for JFR (jdk.internal.events) in order to >> clean

Re: RFR: 8305457: Implement java.io.IO [v13]

2024-05-23 Thread Stuart Marks
On Thu, 23 May 2024 17:14:19 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merg

Re: RFR: 8332084: Ensure JdkConsoleImpl.restoreEcho visibility in a shutdown hook [v9]

2024-05-24 Thread Stuart Marks
On Fri, 24 May 2024 15:38:16 GMT, Naoto Sato wrote: >> Making sure `restoreEcho` correctly reflects the state in the shutdown >> thread, which differs from the application's thread that issues the >> `readPassword()` method. > > Naoto Sato has updated the pull request with a new target base due

Re: RFR: 8328821: Map.of().entrySet() mutators should throw UnsupportedOperationException

2024-05-24 Thread Stuart Marks
On Wed, 27 Mar 2024 17:36:28 GMT, Liam Miller-Cushon wrote: > This change overrides mutator methods in the implementation returned by > `Map.of().entrySet()` to throw `UnsupportedOperationException`. Sorry for the delay, I'm still totally backlogged on other stuff. I can't commit to get this i

Re: RFR: 8333599: Improve description of \b matcher in j.u.r.Pattern

2024-06-06 Thread Stuart Marks
On Thu, 6 Jun 2024 18:16:14 GMT, Raffaello Giulietti wrote: > A documentation-only change to match the original intent and the implemented > behavior. Looks good. The old version with the lookahead and lookbehind was hard to understand and it was inaccurate as well. The descriptive text is ea

Re: RFR: 8333599: Improve description of \b matcher in j.u.r.Pattern

2024-06-06 Thread Stuart Marks
On Thu, 6 Jun 2024 18:16:14 GMT, Raffaello Giulietti wrote: > A documentation-only change to match the original intent and the implemented > behavior. Oh, this needs a CSR too, since it's a change to a normative assertion. Should be pretty simple though. - PR Comment: https://gi

Re: RFR: 8225763: Inflater and Deflater should implement AutoCloseable [v3]

2024-06-16 Thread Stuart Marks
On Sun, 16 Jun 2024 06:36:00 GMT, Jaikiran Pai wrote: >> Can I please get a review of this enhancement which proposes to enhance >> `java.util.zip.Deflater/Inflater` classes to now implement `AutoCloseable`? >> >> The actual work for this was done a few years back when we discussed the >> prop

Re: RFR: 8335637: Add explicit non-null return value expectations to Object.toString() [v4]

2024-07-10 Thread Stuart Marks
On Wed, 10 Jul 2024 05:02:36 GMT, Joe Darcy wrote: >> Make well-behaved implementation expectations of Object.{toString, hashCode} >> explicit. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Narrow scope of the change. Mark

Re: RFR: 8336043: Add quality of implementation discussion to Object.{equals, toString, hashCode}

2024-07-10 Thread Stuart Marks
On Wed, 10 Jul 2024 22:33:54 GMT, Joe Darcy wrote: > First pass at adding some quality of implementation discussions around the > overridable methods of Object. src/java.base/share/classes/java/lang/Object.java line 48: > 46: * to provide reasonable implementations of these methods. In > 47:

Re: RFR: 8336043: Add quality of implementation discussion to Object.{equals, toString, hashCode}

2024-07-10 Thread Stuart Marks
On Wed, 10 Jul 2024 22:33:54 GMT, Joe Darcy wrote: > First pass at adding some quality of implementation discussions around the > overridable methods of Object. src/java.base/share/classes/java/lang/Object.java line 53: > 51: * {@link VirtualMachineError} is possible during the execution of a

Re: RFR: 8336043: Add quality of implementation discussion to Object.{equals, toString, hashCode}

2024-07-10 Thread Stuart Marks
On Wed, 10 Jul 2024 22:33:54 GMT, Joe Darcy wrote: > First pass at adding some quality of implementation discussions around the > overridable methods of Object. @kevinb9n You should take a look at this. - PR Comment: https://git.openjdk.org/jdk/pull/20128#issuecomment-2221761107

Re: RFR: 8336043: Add quality of implementation discussion to Object.{equals, toString, hashCode}

2024-07-10 Thread Stuart Marks
On Wed, 10 Jul 2024 23:16:07 GMT, Joe Darcy wrote: >> src/java.base/share/classes/java/lang/Object.java line 126: >> >>> 124: * >>> 125: * As as a quality of implementation concern, a particular >>> 126: * implementation of this method may or may not support generating >> >> "may

Re: RFR: 8328821: Map.of() derived view collection mutators should throw UnsupportedOperationException [v7]

2024-07-10 Thread Stuart Marks
On Tue, 9 Jul 2024 23:17:47 GMT, Liam Miller-Cushon wrote: >> This change overrides mutator methods in the implementation returned by >> `Map.of().entrySet()` to throw `UnsupportedOperationException`. > > Liam Miller-Cushon has updated the pull request incrementally with one > additional commit

Re: RFR: 8336043: Add quality of implementation discussion to Object.{equals, toString, hashCode}

2024-07-11 Thread Stuart Marks
On Wed, 10 Jul 2024 22:33:54 GMT, Joe Darcy wrote: > First pass at adding some quality of implementation discussions around the > overridable methods of Object. Bloch's _Effective Java, 3/e,_ Items 10, 11, and 12 have some useful background information on implementing equals, hashCode, and toS

Re: RFR: 8325679: Optimize ArrayList subList sort [v4]

2024-08-27 Thread Stuart Marks
On Tue, 9 Jul 2024 18:53:44 GMT, Attila Szegedi wrote: >> Attila Szegedi has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove test > > Keep it open, please. @szegedi Hi Attila, sorry for the long delay on this. If you update the PR p

Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v8]

2022-09-27 Thread Stuart Marks
changes here should coordinate with > similar changes to JLS 12.8, JVMS 5.7, and the Invocation API chapter of the > _JNI Specification._ Stuart Marks has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brough

Re: RFR: 8065554: MatchResult should provide values of named-capturing groups [v7]

2022-09-27 Thread Stuart Marks
On Thu, 22 Sep 2022 10:22:40 GMT, Raffaello Giulietti wrote: >> Add support for named groups to java.util.regex.MatchResult > > Raffaello Giulietti has updated the pull request incrementally with one > additional commit since the last revision: > > 8065554: MatchResult should provide values

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V) [v4]

2022-09-28 Thread Stuart Marks
On Fri, 6 May 2022 22:05:35 GMT, liach wrote: >> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare >> values by identity. Updated API documentation of these two methods >> ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityHashMap.html#remove(java.lang.Objec

Re: RFR: 8279361: Error in documentation of third Stream.reduce method

2022-09-29 Thread Stuart Marks
On Wed, 28 Sep 2022 15:36:50 GMT, Viktor Klang wrote: > This JavaDoc change attempts to shine some light on the `combiner`-function > as it relates to the third variant of `Stream.reduce` since it according to > the bug submission in JBS can be confusing that the `combiner` is not > mentioned

Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v6]

2022-09-30 Thread Stuart Marks
On Thu, 11 Aug 2022 10:35:55 GMT, Daniel Fuchs wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revise Implementation Note discussing JNI Invocation API. > > src/java.base/share/class

Re: RFR: 8279361: Error in documentation of third Stream.reduce method

2022-09-30 Thread Stuart Marks
On Wed, 28 Sep 2022 15:36:50 GMT, Viktor Klang wrote: > This JavaDoc change attempts to shine some light on the `combiner`-function > as it relates to the third variant of `Stream.reduce` since it according to > the bug submission in JBS can be confusing that the `combiner` is not > mentioned

Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v7]

2022-09-30 Thread Stuart Marks
On Thu, 1 Sep 2022 06:31:11 GMT, David Holmes wrote: >> There are subtle differences (invoking a virtual Thread's run method >> directly does no nothing) but that is too much detail and would confusing to >> say anything about in the introduction paragraphs. >> >> The following is closer to wh

Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v4]

2022-09-30 Thread Stuart Marks
On Thu, 11 Aug 2022 07:23:28 GMT, David Holmes wrote: >> What you have is okay although I would have preferred if the sentence on the >> join method was in the previous paragraph rather as it fits with termination. > > Plus one on the join() bit. You could also argue for mentioning isAlive() >

Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v9]

2022-09-30 Thread Stuart Marks
changes here should coordinate with > similar changes to JLS 12.8, JVMS 5.7, and the Invocation API chapter of the > _JNI Specification._ Stuart Marks has updated the pull request incrementally with one additional commit since the last revision: Additional edits to Runtim

Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v9]

2022-09-30 Thread Stuart Marks
On Fri, 30 Sep 2022 21:46:34 GMT, Stuart Marks wrote: >> The concept of the shutdown sequence needs to be specified more clearly. >> This PR adds text for this into the class specification of >> `java.lang.Runtime`. Also includes adjustments to related areas in >>

Re: RFR: JDK-8294539: Augment discussion of equivalence relations on floating-point values [v2]

2022-10-03 Thread Stuart Marks
On Fri, 30 Sep 2022 17:24:40 GMT, Joe Darcy wrote: >> While the floating-point == operation is *not* an equivalence relation, >> there are useful equivalence relations that can be defined over >> floating-point values. Text is added to java.lang.Double to discuss and name >> those relations. >

Re: RFR: JDK-8294539: Augment discussion of equivalence relations on floating-point values [v2]

2022-10-03 Thread Stuart Marks
On Fri, 30 Sep 2022 17:24:40 GMT, Joe Darcy wrote: >> While the floating-point == operation is *not* an equivalence relation, >> there are useful equivalence relations that can be defined over >> floating-point values. Text is added to java.lang.Double to discuss and name >> those relations. >

Re: Collections.shuffle to accept RandomGenerator

2022-10-03 Thread Stuart Marks
I'm ok with not adding a default shuffle() method to List. Shuffling does seem fairly rare, and it potentially has a some semantic issues regarding updates to the RNG state. Those would make it difficult to specify or to override without possibly breaking the contract. Having a List::shuffle d

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface

2022-10-03 Thread Stuart Marks
On Sat, 1 Oct 2022 08:06:44 GMT, Tagir F. Valeev wrote: > Java 17 added RandomGenerator interface. However, existing method > Collections.shuffle accepts old java.util.Random class. While since Java 19, > it's possible to use Random.from(RandomGenerator) wrapper, it would be more > convenient

Re: RFR: JDK-8294539: Augment discussion of equivalence relations on floating-point values [v3]

2022-10-04 Thread Stuart Marks
On Tue, 4 Oct 2022 05:55:00 GMT, Joe Darcy wrote: >> While the floating-point == operation is *not* an equivalence relation, >> there are useful equivalence relations that can be defined over >> floating-point values. Text is added to java.lang.Double to discuss and name >> those relations. >

Re: RFR: JDK-8294539: Augment discussion of equivalence relations on floating-point values [v2]

2022-10-04 Thread Stuart Marks
On Tue, 4 Oct 2022 19:28:24 GMT, Joe Darcy wrote: >> Update as suggested and added some cross-links in from BigDecimal; thanks. > > PS To further spell things out, I added an additional trailing paragraph: > > "For two binary floating-point values a and b, if neither of a and b is zero > or NaN

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V) [v4]

2022-10-04 Thread Stuart Marks
some cross-references, so I think the spec is overall much tighter now. I've pushed a branch with my proposed spec changes. Please merge from https://github.com/stuart-marks/jdk/tree/JDK-8178355-IdentityHashMap which should be based on the current head of this PR branch. The next step would be th

Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v10]

2022-10-04 Thread Stuart Marks
changes here should coordinate with > similar changes to JLS 12.8, JVMS 5.7, and the Invocation API chapter of the > _JNI Specification._ Stuart Marks has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brough

Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v10]

2022-10-04 Thread Stuart Marks
On Wed, 5 Oct 2022 03:34:47 GMT, Stuart Marks wrote: >> The concept of the shutdown sequence needs to be specified more clearly. >> This PR adds text for this into the class specification of >> `java.lang.Runtime`. Also includes adjustments to related areas in >>

Re: Sequenced Collections

2022-10-05 Thread Stuart Marks
On 10/4/22 9:38 PM, Ernie Rael wrote: Summary of key points (maybe the mail was TL;DR) OK thanks, I was still mulling over the previous email wondering which parts were significant enough to reply to.  * SequencedCollection methods addFirst,addLast are the only methods in    Collection

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V) [v6]

2022-10-05 Thread Stuart Marks
On Wed, 5 Oct 2022 03:40:27 GMT, liach wrote: >> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare >> values by identity. Updated API documentation of these two methods >> ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityHashMap.html#remove(java.lang.Objec

Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v10]

2022-10-05 Thread Stuart Marks
On Wed, 5 Oct 2022 03:34:47 GMT, Stuart Marks wrote: >> The concept of the shutdown sequence needs to be specified more clearly. >> This PR adds text for this into the class specification of >> `java.lang.Runtime`. Also includes adjustments to related areas in >>

Integrated: 8290036: Define and specify Runtime shutdown sequence

2022-10-05 Thread Stuart Marks
On Fri, 8 Jul 2022 23:00:15 GMT, Stuart Marks wrote: > The concept of the shutdown sequence needs to be specified more clearly. This > PR adds text for this into the class specification of `java.lang.Runtime`. > Also includes adjustments to related areas in `addShutdownHook`, `halt`,

Re: [External] : Re: Sequenced Collections

2022-10-10 Thread Stuart Marks
nt, if you want to compare elements of a SequencedCollection to those of another, in encounter order, you can just use regular Iterators for that. ListIterator isn't necessary. s'marks On 10/5/22 3:36 PM, Ernie Rael wrote: On 10/5/22 9:34 AM, Stuart Marks wrote: On 10/4/22

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v2]

2022-10-10 Thread Stuart Marks
On Sat, 8 Oct 2022 15:35:14 GMT, Tagir F. Valeev wrote: >> Java 17 added RandomGenerator interface. However, existing method >> Collections.shuffle accepts old java.util.Random class. While since Java 19, >> it's possible to use Random.from(RandomGenerator) wrapper, it would be more >> conveni

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v2]

2022-10-10 Thread Stuart Marks
On Sat, 8 Oct 2022 15:35:14 GMT, Tagir F. Valeev wrote: >> Java 17 added RandomGenerator interface. However, existing method >> Collections.shuffle accepts old java.util.Random class. While since Java 19, >> it's possible to use Random.from(RandomGenerator) wrapper, it would be more >> conveni

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v2]

2022-10-10 Thread Stuart Marks
On Sat, 8 Oct 2022 15:35:14 GMT, Tagir F. Valeev wrote: >> Java 17 added RandomGenerator interface. However, existing method >> Collections.shuffle accepts old java.util.Random class. While since Java 19, >> it's possible to use Random.from(RandomGenerator) wrapper, it would be more >> conveni

Re: [External] : Re: New candidate JEP: 431: Sequenced Collections

2022-10-15 Thread Stuart Marks
Hi Rémi, On 10/14/22 1:20 AM, Remi Forax wrote: People will again think that i'm the grumpy guy but i prefer to voice my concerns. - nobody cares, i'm back from Devoxx and nobody cares about Sequenced Collections, i've tried to ask several friends what they think about it and the answer was "

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v3]

2022-10-28 Thread Stuart Marks
On Wed, 12 Oct 2022 13:26:29 GMT, Tagir F. Valeev wrote: >> Java 17 added RandomGenerator interface. However, existing method >> Collections.shuffle accepts old java.util.Random class. While since Java 19, >> it's possible to use Random.from(RandomGenerator) wrapper, it would be more >> conven

Re: [External] : Re: New candidate JEP: 431: Sequenced Collections

2022-10-28 Thread Stuart Marks
On 10/18/22 8:04 AM, fo...@univ-mlv.fr wrote: Introduction of new types always poses a dilemma for library maintainers. They can move forward aggressively and embrace new features, or they can remain on older releases in order to reach a broader audience. That's not a reason to avoid introduci

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

2022-10-31 Thread Stuart Marks
On Mon, 31 Oct 2022 20:11:34 GMT, Jim Laskey wrote: >> 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 evalu

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V) [v6]

2022-10-31 Thread Stuart Marks
On Wed, 5 Oct 2022 03:40:27 GMT, liach wrote: >> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare >> values by identity. Updated API documentation of these two methods >> ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityHashMap.html#remove(java.lang.Objec

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V) [v6]

2022-11-02 Thread Stuart Marks
On Wed, 5 Oct 2022 03:40:27 GMT, liach wrote: >> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare >> values by identity. Updated API documentation of these two methods >> ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityHashMap.html#remove(java.lang.Objec

Re: RFR: 8292317: Missing null check for Iterator.forEachRemaining implementations

2022-11-16 Thread Stuart Marks
On Tue, 15 Nov 2022 02:10:01 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which proposes to fix > https://bugs.openjdk.org/browse/JDK-8292317? > > The `java.util.Iterator` has a `forEachRemaining(Consumer action)` > method. As per its contract, the implementations are ex

Re: RFR: 8292317: Missing null check for Iterator.forEachRemaining implementations [v2]

2022-11-18 Thread Stuart Marks
On Thu, 17 Nov 2022 06:05:40 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to fix >> https://bugs.openjdk.org/browse/JDK-8292317? >> >> The `java.util.Iterator` has a `forEachRemaining(Consumer >> action)` method. As per its contract, the implementations a

Re: RFR: 8295857: Clarify that cleanup code can be skipped when the JVM terminates (e.g. when calling halt()) [v4]

2022-11-23 Thread Stuart Marks
On Tue, 22 Nov 2022 22:24:00 GMT, David Holmes wrote: >> Brent Christian has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update Runtime class doc re: other unexpected behaviors > > src/java.base/share/classes/java/lang/Runtime.java line

Re: RFR: 8295857: Clarify that cleanup code can be skipped when the JVM terminates (e.g. when calling halt()) [v4]

2022-11-23 Thread Stuart Marks
On Tue, 22 Nov 2022 00:50:51 GMT, Brent Christian wrote: >> [JDK-8290036](https://bugs.openjdk.org/browse/JDK-8290036) documented the >> shutdown sequence, noting that calling Runtime.halt() skips the shutdown >> sequence and immediately terminates the VM. Thus, "threads' current methods >> do

Re: RFR: 8297295: Remove ThreadGroup.allowThreadSuspension

2022-11-28 Thread Stuart Marks
On Fri, 25 Nov 2022 18:54:28 GMT, Alan Bateman wrote: > Another small step in the multi-release/multi-year effort to remove cruft > from Thread/ThreadGroup. > > java.lang.ThreadGroup.allowThreadSuspension(boolean) dates from JDK 1.1 and > the Classic VM. The method controlled whether threads w

Re: RFR: 8297295: Remove ThreadGroup.allowThreadSuspension

2022-11-28 Thread Stuart Marks
On Mon, 28 Nov 2022 13:13:09 GMT, Jaikiran Pai wrote: >> Another small step in the multi-release/multi-year effort to remove cruft >> from Thread/ThreadGroup. >> >> java.lang.ThreadGroup.allowThreadSuspension(boolean) dates from JDK 1.1 and >> the Classic VM. The method controlled whether thre

Re: RFR: 8295857: Clarify that cleanup code can be skipped when the JVM terminates (e.g. when calling halt()) [v7]

2022-12-08 Thread Stuart Marks
On Wed, 7 Dec 2022 17:38:31 GMT, Brent Christian wrote: >> [JDK-8290036](https://bugs.openjdk.org/browse/JDK-8290036) documented the >> shutdown sequence, noting that calling Runtime.halt() skips the shutdown >> sequence and immediately terminates the VM. Thus, "threads' current methods >> do

RFR: 8299237: add ArraysSupport.newLength test to a test group

2022-12-22 Thread Stuart Marks
This test isn't part of any test group, so it isn't being run regularly! I'm adding it to the jdk_util_other test group. - Commit messages: - Add jdk/internal/util to jdk_util_other test group Changes: https://git.openjdk.org/jdk/pull/11769/files Webrev: https://webrevs.openjdk.or

Re: RFR: 8299237: add ArraysSupport.newLength test to a test group

2022-12-22 Thread Stuart Marks
On Thu, 22 Dec 2022 19:47:30 GMT, Roger Riggs wrote: >> This test isn't part of any test group, so it isn't being run regularly! I'm >> adding it to the jdk_util_other test group. > > LGTM; Test fixes are ok for JDK 20 backport. @RogerRiggs > LGTM; Test fixes are ok for JDK 20 backport. Than

Re: RFR: 8299237: add ArraysSupport.newLength test to a test group

2022-12-22 Thread Stuart Marks
On Thu, 22 Dec 2022 19:37:12 GMT, Stuart Marks wrote: > This test isn't part of any test group, so it isn't being run regularly! I'm > adding it to the jdk_util_other test group. OK, I guess I'll need to withdraw this PR and open a new one against JDK 20.

Re: RFR: 8299237: add ArraysSupport.newLength test to a test group

2022-12-22 Thread Stuart Marks
On Thu, 22 Dec 2022 19:37:12 GMT, Stuart Marks wrote: > This test isn't part of any test group, so it isn't being run regularly! I'm > adding it to the jdk_util_other test group. Yeah it would probably be simpler but it would clutter up the history. I've already st

Withdrawn: 8299237: add ArraysSupport.newLength test to a test group

2022-12-22 Thread Stuart Marks
On Thu, 22 Dec 2022 19:37:12 GMT, Stuart Marks wrote: > This test isn't part of any test group, so it isn't being run regularly! I'm > adding it to the jdk_util_other test group. This pull request has been closed without being integrated. - PR: https://git

Re: RFR: 8299237: add ArraysSupport.newLength test to a test group

2022-12-22 Thread Stuart Marks
On Thu, 22 Dec 2022 19:37:12 GMT, Stuart Marks wrote: > This test isn't part of any test group, so it isn't being run regularly! I'm > adding it to the jdk_util_other test group. Closing this in favor of PR https://github.com/openjdk/jdk20/pull/73 on JDK 20. ---

[jdk20] RFR: 8299237: add ArraysSupport.newLength test to a test group

2022-12-22 Thread Stuart Marks
It was running as part of tier4 (which is kind of a catch-all tier) but since it's (an internal) part of java.util, it should really be in tier1. This adds the test/jdk/jdk/internal/util directory to the :jdk_util_other test group. - Commit messages: - 8299237: add ArraysSupport.ne

[jdk20] Integrated: 8299237: add ArraysSupport.newLength test to a test group

2022-12-22 Thread Stuart Marks
On Thu, 22 Dec 2022 21:25:39 GMT, Stuart Marks wrote: > It was running as part of tier4 (which is kind of a catch-all tier) but since > it's (an internal) part of java.util, it should really be in tier1. This adds > the test/jdk/jdk/internal/util directory to the :jdk_util_ot

Re: RFR: 8189338: JMX RMI Remote Mbean server connection hangs if the server stops responding during a SSL Handshake

2023-01-03 Thread Stuart Marks
On Tue, 3 Jan 2023 13:35:32 GMT, Daniel Jeliński wrote: > This patch introduces a time limit for establishing a secure connection to a > RMI server. > > The existing implementation uses the configured > `sun.rmi.transport.tcp.handshakeTimeout` during RMI handshake only; there's > no time limi

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections

2023-01-04 Thread Stuart Marks
On Wed, 4 Jan 2023 14:41:20 GMT, Viktor Klang wrote: > Currently Set.copyOf allocates both a HashSet and a new empty array when the > input collection is empty. > > This patch avoids allocating anything for the case where the parameter > collection's isEmpty returns true. There's no regressio

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v3]

2023-01-04 Thread Stuart Marks
On Wed, 12 Oct 2022 13:26:29 GMT, Tagir F. Valeev wrote: >> Java 17 added RandomGenerator interface. However, existing method >> Collections.shuffle accepts old java.util.Random class. While since Java 19, >> it's possible to use Random.from(RandomGenerator) wrapper, it would be more >> conven

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v3]

2023-01-04 Thread Stuart Marks
On Sat, 3 Dec 2022 08:23:34 GMT, Tagir F. Valeev wrote: >> Tagir F. Valeev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fixes according to review >> >> 1. Reduce duplication in tests >> 2. Use JumpableGenerator#copy() instead o

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections [v2]

2023-01-09 Thread Stuart Marks
On Mon, 9 Jan 2023 08:33:09 GMT, Viktor Klang wrote: >> Currently Set.copyOf allocates both a HashSet and a new empty array when the >> input collection is empty. >> >> This patch avoids allocating anything for the case where the parameter >> collection's isEmpty returns true. > > Viktor Klang

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections [v2]

2023-01-09 Thread Stuart Marks
On Mon, 9 Jan 2023 08:33:09 GMT, Viktor Klang wrote: >> Currently Set.copyOf allocates both a HashSet and a new empty array when the >> input collection is empty. >> >> This patch avoids allocating anything for the case where the parameter >> collection's isEmpty returns true. > > Viktor Klang

Re: RFR: 8283660: Convert com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java finalizer to Cleaner [v16]

2023-01-09 Thread Stuart Marks
On Fri, 22 Jul 2022 20:51:59 GMT, Brent Christian wrote: >> Please review this change to replace the finalizer in >> `AbstractLdapNamingEnumeration` with a Cleaner. >> >> The pieces of state required for cleanup (`LdapCtx homeCtx`, `LdapResult >> res`, and `LdapClient enumClnt`) are moved to a

Re: RFR: 8299513: Clean up java.io [v9]

2023-01-11 Thread Stuart Marks
On Wed, 11 Jan 2023 15:31:22 GMT, Per Minborg wrote: >> Code in java.io contains many legacy constructs and semantics not >> recommended including: >> >> * C-style array declaration >> * Unnecessary visibility >> * Redundant keywords in interfaces (e.g. public, static) >> * Non-standard nam

RFR: 8038146: Clarify NavigableMap/TreeMap support for Entry.setValue

2023-01-11 Thread Stuart Marks
Also additional verbiage regarding Map.Entry objects in general and their possible connection to an underlying Map. - Commit messages: - 8038146: Clarify NavigableMap/TreeMap support for Entry.setValue Changes: https://git.openjdk.org/jdk/pull/11956/files Webrev: https://webrevs.o

Re: RFR: 8038146: Clarify NavigableMap/TreeMap support for Entry.setValue

2023-01-13 Thread Stuart Marks
On Fri, 13 Jan 2023 15:02:00 GMT, Alan Bateman wrote: >> Also additional verbiage regarding Map.Entry objects in general and their >> possible connection to an underlying Map. > > src/java.base/share/classes/java/util/Map.java line 405: > >> 403: * {@link Iterator} or implicitly via the en

Re: RFR: 8038146: Clarify NavigableMap/TreeMap support for Entry.setValue

2023-01-13 Thread Stuart Marks
On Fri, 13 Jan 2023 15:04:21 GMT, Alan Bateman wrote: >> Also additional verbiage regarding Map.Entry objects in general and their >> possible connection to an underlying Map. > > src/java.base/share/classes/java/util/Map.java line 421: > >> 419: * {@link Set#toArray toArray} overloads, >>

Re: RFR: 8038146: Clarify NavigableMap/TreeMap support for Entry.setValue [v2]

2023-01-13 Thread Stuart Marks
> Also additional verbiage regarding Map.Entry objects in general and their > possible connection to an underlying Map. Stuart Marks has updated the pull request incrementally with one additional commit since the last revision: Updates from Alan. - Changes: - all:

Re: RFR: 8203035: Implement equals() and hashCode() for Throwable

2023-01-17 Thread Stuart Marks
On Sat, 10 Dec 2022 18:11:30 GMT, Victor Toni wrote: > Being able to compare instances of Throwable allows simple detection of > exceptions raised by the same circumstances. Comparison allows for reduction > of excessive logging e.g. in hotspots without requiring custom code to > compare Throw

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v4]

2023-01-18 Thread Stuart Marks
On Sun, 15 Jan 2023 07:52:53 GMT, Tagir F. Valeev wrote: >> Java 17 added RandomGenerator interface. However, existing method >> Collections.shuffle accepts old java.util.Random class. While since Java 19, >> it's possible to use Random.from(RandomGenerator) wrapper, it would be more >> conven

Re: RFR: JDK-8300133: Use generalized see and link tags in core libs [v2]

2023-01-18 Thread Stuart Marks
On Fri, 13 Jan 2023 22:54:47 GMT, Joe Darcy wrote: >> With generalized see and link tags that can refer to anchors (JDK-8200337), >> the see and link tags in core libraries should be updated to use this >> feature when possible. This PR covers such updates for java.base. > > Joe Darcy has updat

Re: RFR: JDK-8300594: Use generalized see and link tags in UnicastRemoteObject

2023-01-18 Thread Stuart Marks
On Wed, 18 Jan 2023 21:27:03 GMT, Joe Darcy wrote: > Use improved anchor syntax in UnicastRemoteObject. Marked as reviewed by smarks (Reviewer). - PR: https://git.openjdk.org/jdk/pull/12083

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v4]

2023-01-18 Thread Stuart Marks
On Sun, 15 Jan 2023 07:52:53 GMT, Tagir F. Valeev wrote: >> Java 17 added RandomGenerator interface. However, existing method >> Collections.shuffle accepts old java.util.Random class. While since Java 19, >> it's possible to use Random.from(RandomGenerator) wrapper, it would be more >> conven

Re: RFR: 8038146: Clarify Map.Entry's connection to the underlying map [v2]

2023-01-18 Thread Stuart Marks
On Sat, 14 Jan 2023 03:56:33 GMT, Stuart Marks wrote: >> Also additional verbiage regarding Map.Entry objects in general and their >> possible connection to an underlying Map. > > Stuart Marks has updated the pull request incrementally with one additional > commit si

Re: RFR: 8300207: Add a pre-check for the number of canonical equivalent permutations in j.u.r.Pattern [v2]

2023-01-19 Thread Stuart Marks
On Tue, 17 Jan 2023 12:23:25 GMT, Alan Bateman wrote: >> The choice of a `` paragraph rather than `@apiNote` is for consistency >> with similar commentary paragraphs in the specs of `CASE_INSENSITIVE`, >> `UNICODE_CASE`, and `UNICODE_CHARACTER_CLASS`. >> >> I have no problems in using `@apiNot

Re: RFR: 8300207: Add a pre-check for the number of canonical equivalent permutations in j.u.r.Pattern [v2]

2023-01-19 Thread Stuart Marks
On Thu, 19 Jan 2023 15:27:04 GMT, Raffaello Giulietti wrote: >> - Strengthen a computation that could overflow. >> - Specify that use of CANON_EQ could exhaust memory in the compilation phase. > > Raffaello Giulietti has updated the pull request incrementally with one > additional commit since

Re: RFR: 8300207: Add a pre-check for the number of canonical equivalent permutations in j.u.r.Pattern [v2]

2023-01-19 Thread Stuart Marks
On Fri, 20 Jan 2023 01:56:16 GMT, Stuart Marks wrote: >> Okay, I see your point and to use apiNote consistently would require >> "converting" some of the existing text to apiNote too. >> >> I'm still mulling over Pattern.compile throwing OOME. An implNote

Integrated: 8038146: Clarify Map.Entry's connection to the underlying map

2023-01-20 Thread Stuart Marks
On Thu, 12 Jan 2023 01:50:51 GMT, Stuart Marks wrote: > Also additional verbiage regarding Map.Entry objects in general and their > possible connection to an underlying Map. This pull request has now been integrated. Changeset: c6d56003 Author:Stuart Marks URL:

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException

2023-01-22 Thread Stuart Marks
On Mon, 23 Jan 2023 02:35:19 GMT, Tingjun Yuan wrote: > Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a > `ClassCastException` (as documented in `java.util.List`) when attempting to > set an element with a wrong type. We don't want to change long-standing exception-throwing beh

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v6]

2023-01-23 Thread Stuart Marks
On Sat, 21 Jan 2023 19:38:16 GMT, Sergey Bylokhov wrote: >> Tagir F. Valeev has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Whitespaces fixed >> - @implSpec added to shuffle(List) > > Filed, will create a PR soon. > https://bugs.openj

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections [v2]

2023-01-24 Thread Stuart Marks
On Sun, 22 Jan 2023 15:20:18 GMT, Attila Szegedi wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - 8299444: java.util.Set.copyOf allocates needlessly for empty input >> collections >> >>Modifies Immuta

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections [v5]

2023-01-24 Thread Stuart Marks
On Tue, 24 Jan 2023 19:43:14 GMT, Viktor Klang wrote: >> Currently Set.copyOf allocates both a HashSet and a new empty array when the >> input collection is empty. >> >> This patch avoids allocating anything for the case where the parameter >> collection's isEmpty returns true. > > Viktor Klan

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections [v2]

2023-01-24 Thread Stuart Marks
important. >> >> With that in mind, for the Set and Map cases, could you (Viktor) add similar >> comments there? Arguably they should have been there already, but, oh well, >> they weren't. Thanks. > > @stuart-marks Makes sense. I've added those comments

Re: RFR: 8301120: Cleanup utility classes java.util.Arrays and java.util.Collections [v2]

2023-01-26 Thread Stuart Marks
On Wed, 25 Jan 2023 22:23:26 GMT, Tagir F. Valeev wrote: >> number of minor cleanups could be done in Arrays and Collections utility >> classes. >> In Arrays: >> - Redundant import jdk.internal.misc.Unsafe; >> - C-style array declaration is used in public static boolean equals(short[] >> a, sho

Re: RFR: 8301120: Cleanup utility classes java.util.Arrays and java.util.Collections [v2]

2023-01-26 Thread Stuart Marks
On Wed, 25 Jan 2023 22:23:26 GMT, Tagir F. Valeev wrote: >> number of minor cleanups could be done in Arrays and Collections utility >> classes. >> In Arrays: >> - Redundant import jdk.internal.misc.Unsafe; >> - C-style array declaration is used in public static boolean equals(short[] >> a, sho

Re: RFR: 8301120: Cleanup utility classes java.util.Arrays and java.util.Collections [v2]

2023-01-27 Thread Stuart Marks
On Wed, 25 Jan 2023 22:23:26 GMT, Tagir F. Valeev wrote: >> number of minor cleanups could be done in Arrays and Collections utility >> classes. >> In Arrays: >> - Redundant import jdk.internal.misc.Unsafe; >> - C-style array declaration is used in public static boolean equals(short[] >> a, sho

Re: RFR: 8301042: Need methods to check null elements in an array or a collection [v5]

2023-01-29 Thread Stuart Marks
On Sun, 29 Jan 2023 10:39:22 GMT, Tingjun Yuan wrote: >> Adding the following methods to check the nullity of elements of an array or >> a collection: >> >> >> java.util.Arrays: >> public static E[] requireNoNulls(E[] array) >> public static E[] requireNoNulls(E[] array, String message) >> p

Re: NPE throwing behavior of immutable collections

2023-01-30 Thread Stuart Marks
In this reply I'll focus on the null handling issues in collections. As you've noted, there are really (at least) two distinct issues here: whether a collection permits nulls, and the behavior of contains(null) queries. There have been continual complaints about both, and the issues are somewha

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Stuart Marks
On Tue, 7 Feb 2023 15:25:05 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Stuart Marks
On Tue, 7 Feb 2023 19:12:38 GMT, Claes Redestad wrote: > It might be that the redundant checks in Arrays.copyOfRange would be > eliminated properly with more inlining, and that the issue here is that the > affected String constructor is particularly gnarly. This gnarliness is due 1) > the need

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v7]

2023-02-08 Thread Stuart Marks
On Mon, 23 Jan 2023 07:33:21 GMT, Tingjun Yuan wrote: >> Document `java.util.Arrays.asList` that the list will throw an >> `ArrayStoreException` when attempting to set an element with a wrong type. > > Tingjun Yuan has updated the pull request incrementally with one additional > commit since th

Re: RFR: 8283660: Convert com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java finalizer to Cleaner [v16]

2023-02-08 Thread Stuart Marks
On Fri, 22 Jul 2022 20:51:59 GMT, Brent Christian wrote: >> Please review this change to replace the finalizer in >> `AbstractLdapNamingEnumeration` with a Cleaner. >> >> The pieces of state required for cleanup (`LdapCtx homeCtx`, `LdapResult >> res`, and `LdapClient enumClnt`) are moved to a

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v4]

2023-02-14 Thread Stuart Marks
On Tue, 14 Feb 2023 18:56:29 GMT, Roger Riggs wrote: >> It can be difficult to find the cause of calls to >> `java.lang.System.exit(status)` and `Runtime.exit(status)` because the Java >> runtime exits. >> The status value and stack trace are logged using the System Logger named >> `java.lang.

  1   2   3   4   5   6   >