mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8311188: Simplify and modernize equals and hashCode in java.text
Reviewed-by: lancea, naoto, rriggs
This commit is contained in:
parent
1fc726a8b3
commit
1dfb0fb3e2
15 changed files with 72 additions and 98 deletions
|
@ -2354,7 +2354,11 @@ public final class CompactNumberFormat extends NumberFormat {
|
|||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!super.equals(obj)) { // super does null and class checks
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2369,9 +2373,7 @@ public final class CompactNumberFormat extends NumberFormat {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the hash code for this {@code CompactNumberFormat} instance.
|
||||
*
|
||||
* @return hash code for this {@code CompactNumberFormat}
|
||||
* {@return the hash code for this {@code CompactNumberFormat} instance}
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue