vorburger commented on a change in pull request #670: FINERACT-702: Integrate
SpotBugs and fix over 300 high priority issues
URL: https://github.com/apache/fineract/pull/670#discussion_r357920827
##########
File path:
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java
##########
@@ -693,17 +679,35 @@ public boolean hasCurrencyCodeOf(final String
matchingCurrencyCode) {
}
@Override
- public boolean equals(final Object obj) {
- if (obj == null) { return false; }
- if (obj == this) { return true; }
- if (obj.getClass() != getClass()) { return false; }
- final SavingsAccountCharge rhs = (SavingsAccountCharge) obj;
- return new EqualsBuilder().appendSuper(super.equals(obj)) //
- .append(getId(), rhs.getId()) //
- .append(this.charge.getId(), rhs.charge.getId()) //
- .append(this.amount, rhs.amount) //
- .append(getDueLocalDate(), rhs.getDueLocalDate()) //
- .isEquals();
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof SavingsAccountCharge)) return false;
+ SavingsAccountCharge that = (SavingsAccountCharge) o;
+ return penaltyCharge == that.penaltyCharge &&
+ paid == that.paid &&
+ waived == that.waived &&
+ status == that.status &&
+ savingsAccount.equals(that.savingsAccount) &&
Review comment:
again, this is not null safe (use Objects.equals helper)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services