mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +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
|
@ -2918,10 +2918,13 @@ public class DecimalFormat extends NumberFormat {
|
|||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!super.equals(obj))
|
||||
return false; // super does class check
|
||||
return false; // super does null and class checks
|
||||
|
||||
DecimalFormat other = (DecimalFormat) obj;
|
||||
return ((posPrefixPattern == other.posPrefixPattern &&
|
||||
positivePrefix.equals(other.positivePrefix))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue