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

2023-07-05 Thread Pavel Rappo
On Wed, 5 Jul 2023 17:39:49 GMT, Roger Riggs wrote: >> Do you mean we could use `obj instanceof DecimalFormat other` in front of >> that 30-line `&&` expression, or that we could collapse the list to exactly >> what you wrote? >> >> Separately, `super.equals` already performs the class check;

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

2023-07-05 Thread Roger Riggs
On Wed, 5 Jul 2023 16:39:58 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/java/text/CompactNumberFormat.java line 2364: >> >>> 2362: return true; >>> 2363: } >>> 2364: >> >> Moving this before the `super.equals` call performance-wise would favor the >> equals cas

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

2023-07-05 Thread Roger Riggs
On Wed, 5 Jul 2023 16:27:38 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/java/text/DecimalFormat.java line 2930: >> >>> 2928: DecimalFormat other = (DecimalFormat) obj; >>> 2929: return ((posPrefixPattern == other.posPrefixPattern && >>> 2930: positiveP

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

2023-07-05 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.