}
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;
* @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])) {