Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v3]

2024-07-08 Thread Roger Riggs
On Mon, 8 Jul 2024 20:32:52 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: > > Respond to review feedback. Looks

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v2]

2024-07-08 Thread Joe Darcy
On Mon, 8 Jul 2024 18:04:49 GMT, Alan Bateman wrote: > Specifying that toString returns a non-null result is good. Specifying that > the methods don't throw any exceptions, or an implSpec that the methods > shouldn't throw is okay. > > I'm less sure about the proposed wording for resource usag

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v3]

2024-07-08 Thread Joe Darcy
> 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: Respond to review feedback. - Changes: - all: https://git.openjdk.org/jdk/pull/20

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v2]

2024-07-08 Thread Pavel Rappo
On Mon, 8 Jul 2024 19:12:37 GMT, Joe Darcy wrote: > PS There are cases where cyclic structures are not supported, such as in > java.util.Set: There are algorithms that also don't support that: /** * Returns a hash code based on the "deep contents" of the specified * array. If th

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v2]

2024-07-08 Thread Pavel Rappo
On Mon, 8 Jul 2024 19:01:04 GMT, Joe Darcy wrote: > One tricky part of the implementation was making sure the stack trace output > did cycle detection since there were various ways exceptions could end up > referring to each other. Yes, the tricky part was to "Guard against malicious overrides

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v2]

2024-07-08 Thread Joe Darcy
On Mon, 8 Jul 2024 19:11:43 GMT, Pavel Rappo wrote: >>> While I understand and agree with the intent, we have several exceptions in >>> the OpenJDK itself. >>> >>> Circular structures that throw `StackOverflowError` on `hashCode()` and >>> huge numbers that take 20-30 min to compute `toString(

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v2]

2024-07-08 Thread Joe Darcy
On Mon, 8 Jul 2024 17:04:07 GMT, Raffaello Giulietti wrote: > While I understand and agree with the intent, we have several exceptions in > the OpenJDK itself. > > Circular structures that throw `StackOverflowError` on `hashCode()` and huge > numbers that take 20-30 min to compute `toString()

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v2]

2024-07-08 Thread Alan Bateman
On Mon, 8 Jul 2024 16:46:00 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: > > Update wording. Specifying that t

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v2]

2024-07-08 Thread Raffaello Giulietti
On Mon, 8 Jul 2024 16:42:55 GMT, Joe Darcy wrote: >> My understanding is the same. Personally, the wording reads unambiguously. >> The words "circular" and "circularity" can be seen throughout codebase, in >> similar contexts. >> >> FWIW, a simpler example can be constructed like this: >> >>

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v2]

2024-07-08 Thread Joe Darcy
On Mon, 8 Jul 2024 09:55:27 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/java/lang/Object.java line 101: >> >>> 99: * implementation should not use excessive memory or time for its >>> 100: * computations and should return a result for cyclic data >>> 101: * structures.

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v2]

2024-07-08 Thread Joe Darcy
> 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: Update wording. - Changes: - all: https://git.openjdk.org/jdk/pull/20063/files

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode}

2024-07-08 Thread Pavel Rappo
On Mon, 8 Jul 2024 09:33:54 GMT, Jaikiran Pai wrote: >> Make well-behaved implementation expectations of Object.{toString, hashCode} >> explicit. > > src/java.base/share/classes/java/lang/Object.java line 101: > >> 99: * implementation should not use excessive memory or time for its >> 100

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode}

2024-07-08 Thread Jaikiran Pai
On Sun, 7 Jul 2024 20:20:30 GMT, Joe Darcy wrote: > Make well-behaved implementation expectations of Object.{toString, hashCode} > explicit. src/java.base/share/classes/java/lang/Object.java line 101: > 99: * implementation should not use excessive memory or time for its > 100: * com

Re: RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode}

2024-07-08 Thread Pavel Rappo
On Sun, 7 Jul 2024 20:20:30 GMT, Joe Darcy wrote: > Make well-behaved implementation expectations of Object.{toString, hashCode} > explicit. Looks good. - Marked as reviewed by prappo (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20063#pullrequestreview-2162781503

RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode}

2024-07-07 Thread Joe Darcy
Make well-behaved implementation expectations of Object.{toString, hashCode} explicit. - Commit messages: - JDK-8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} Changes: https://git.openjdk.org/jdk/pull/20063/files Webrev: https://webrevs.openjdk.or