Re: RFR: 8311188: Simplify and modernize equals and hashCode in java.text [v4]

2023-07-12 Thread John R Rose
On Fri, 7 Jul 2023 00:39:20 GMT, Pavel Rappo wrote: >> Thanks @rose00 for the writeup and @pavelrappo for asking pertinent followup >> questions. >> >> For me the issue here is that there is a bunch of lore about avoiding >> `Objects::equals` and it's embodied in comments like this: >> >>> NB

Re: RFR: 8311188: Simplify and modernize equals and hashCode in java.text [v4]

2023-07-06 Thread Pavel Rappo
On Thu, 6 Jul 2023 23:38:01 GMT, Stuart Marks wrote: > For me the issue here is that there is a bunch of lore about avoiding > `Objects::equals` and it's embodied in comments like this: > > > NB: Do not replace with Object.equals until JDK-8015417 is resolved. > > These comments are almost exa

Re: RFR: 8311188: Simplify and modernize equals and hashCode in java.text [v4]

2023-07-06 Thread Stuart Marks
On Tue, 4 Jul 2023 22:03:58 GMT, John R Rose wrote: >>> Hmm, I think that issue refers to code that have explicit non-Object >>> parameter types (like `X::equals(Object)boolean` in the issue's sample). >>> This method already have both arguments as `Object`, so I don't think >>> there's any ty

Re: RFR: 8311188: Simplify and modernize equals and hashCode in java.text [v4]

2023-07-06 Thread Pavel Rappo
On Thu, 6 Jul 2023 14:46:59 GMT, Pavel Rappo wrote: >> I'd suggest replacing the calls to `valuesMatch` with `Objects.equals` and >> remove the `valuesMatch` method as unnecessary. > >> I'd suggest replacing the calls to `valuesMatch` with `Objects.equals` and >> remove the `valuesMatch` method

Re: RFR: 8311188: Simplify and modernize equals and hashCode in java.text [v4]

2023-07-06 Thread Pavel Rappo
On Wed, 5 Jul 2023 15:33:13 GMT, Roger Riggs wrote: > I'd suggest replacing the calls to `valuesMatch` with `Objects.equals` and > remove the `valuesMatch` method as unnecessary. I'll do something about them soon, Roger. But first I need to understand JDK-8015417 better, as it also affects oth

Re: RFR: 8311188: Simplify and modernize equals and hashCode in java.text [v4]

2023-07-06 Thread Pavel Rappo
> Please review this PR to use modern APIs and language features to simplify > `equals` and `hashCode` in the java.text area. > > * Some changes to `equals` and `hashCode` are refactoring rather than > modernization. Such changes can be as trivial as rearranging, adding, or > commenting checks.

Re: RFR: 8311188: Simplify and modernize equals and hashCode in java.text [v4]

2023-07-06 Thread Pavel Rappo
On Wed, 5 Jul 2023 17:44:52 GMT, Roger Riggs wrote: >> You are right, I have no stats. Performance-wise, it's already better than >> what was there before. Before, there was no short-circuit check. But I can >> go either way; I don't have a strong opinion. >> >> Reusing superclass' equals is n