- boolean equal = TextUtils.equals(accountName, other.accountName) &&
- TextUtils.equals(comment, other.comment) &&
- (amountSet ? other.amountSet && amount == other.amount
- : !other.amountSet) &&
- (amountHintIsSet ? other.amountHintIsSet &&
- TextUtils.equals(amountHint, other.amountHint)
- : !other.amountHintIsSet) &&
- TextUtils.equals(currency, other.currency) && isLast == other.isLast;
+ boolean equal = TextUtils.equals(accountName, other.accountName);
+ equal = equal && TextUtils.equals(comment, other.comment) &&
+ (amountSet ? other.amountSet && amount == other.amount : !other.amountSet);
+
+ // compare amount hint only if there is no amount
+ if (!amountSet)
+ equal = equal && (amountHintIsSet ? other.amountHintIsSet &&
+ TextUtils.equals(amountHint, other.amountHint)
+ : !other.amountHintIsSet);
+ equal = equal && TextUtils.equals(currency, other.currency) && isLast == other.isLast;
+