mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-16 10:17:23 +00:00
ICU-8268 equals(Object o) methods assume that o is the correct type.
X-SVN-Rev: 30736
This commit is contained in:
parent
6916271396
commit
7048d48b6e
2 changed files with 9 additions and 3 deletions
|
@ -2055,7 +2055,9 @@ public class DateTimePatternGenerator implements Freezable<DateTimePatternGenera
|
|||
}
|
||||
|
||||
public boolean equals(Object other) {
|
||||
if (other == null) return false;
|
||||
if (!(other instanceof DateTimeMatcher)) {
|
||||
return false;
|
||||
}
|
||||
DateTimeMatcher that = (DateTimeMatcher) other;
|
||||
for (int i = 0; i < original.length; ++i) {
|
||||
if (!original[i].equals(that.original[i])) return false;
|
||||
|
|
|
@ -731,8 +731,12 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
|
|||
* @stable ICU 2.0
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) return false;
|
||||
if (this == obj) return true;
|
||||
if (!(obj instanceof DecimalFormatSymbols)) {
|
||||
return false;
|
||||
}
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
DecimalFormatSymbols other = (DecimalFormatSymbols) obj;
|
||||
for (int i = 0; i <= CURRENCY_SPC_INSERT; i++) {
|
||||
if (!currencySpcBeforeSym[i].equals(other.currencySpcBeforeSym[i])) {
|
||||
|
|
Loading…
Add table
Reference in a new issue