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_r357919953
##########
File path:
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java
##########
@@ -621,4 +600,34 @@ public TaxGroup getTaxGroup() {
public void setTaxGroup(TaxGroup taxGroup) {
this.taxGroup = taxGroup;
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof Charge)) return false;
+ Charge charge = (Charge) o;
+ return penalty == charge.penalty &&
+ active == charge.active &&
+ deleted == charge.deleted &&
+ name.equals(charge.name) &&
+ amount.equals(charge.amount) &&
+ currencyCode.equals(charge.currencyCode) &&
+ chargeAppliesTo.equals(charge.chargeAppliesTo) &&
+ chargeTimeType.equals(charge.chargeTimeType) &&
+ chargeCalculation.equals(charge.chargeCalculation) &&
+ chargePaymentMode.equals(charge.chargePaymentMode) &&
Review comment:
use Objects.equals helper here, as some of these may well be null, and would
cause NPE as is.
----------------------------------------------------------------
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