FINERACT-822 enable BigDecimalEquals error
This commit is contained in:
committed by
Yemdjih Kaze Nasser
parent
73a8816f13
commit
17cb620ec0
@@ -316,7 +316,6 @@ tasks.withType(JavaCompile) {
|
||||
"SameNameButDifferent",
|
||||
"StringSplitter",
|
||||
"MissingOverride",
|
||||
"BigDecimalEquals",
|
||||
"ImmutableEnumChecker",
|
||||
"EqualsUnsafeCast",
|
||||
"BoxedPrimitiveEquality",
|
||||
@@ -341,6 +340,7 @@ tasks.withType(JavaCompile) {
|
||||
"MultiVariableDeclaration",
|
||||
"AssertEqualsArgumentOrderChecker",
|
||||
"EmptySetMultibindingContributions",
|
||||
"BigDecimalEquals",
|
||||
"MixedArrayDimensions",
|
||||
"PackageLocation",
|
||||
"UseBinds",
|
||||
|
||||
+2
-2
@@ -506,7 +506,7 @@ public class AccountTransfersWritePlatformServiceImpl implements AccountTransfer
|
||||
|
||||
BigDecimal overpaid = this.loanReadPlatformService.retrieveTotalPaidInAdvance(fromLoanAccountId).getPaidInAdvance();
|
||||
|
||||
if (overpaid == null || overpaid.equals(BigDecimal.ZERO) || transactionAmount.floatValue() > overpaid.floatValue()) {
|
||||
if (overpaid == null || overpaid.compareTo(BigDecimal.ZERO) == 0 ? Boolean.TRUE:Boolean.FALSE || transactionAmount.floatValue() > overpaid.floatValue()) {
|
||||
if(overpaid == null) {
|
||||
overpaid = BigDecimal.ZERO;
|
||||
}
|
||||
@@ -536,4 +536,4 @@ public class AccountTransfersWritePlatformServiceImpl implements AccountTransfer
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -27,6 +27,7 @@ import static org.apache.fineract.portfolio.interestratechart.InterestRateChartS
|
||||
import static org.apache.fineract.portfolio.interestratechart.InterestRateChartSlabApiConstants.toPeriodParamName;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Comparator;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -304,7 +305,7 @@ public class InterestRateChartSlabFields {
|
||||
|
||||
public boolean isBigDecimalSame(final BigDecimal obj1, final BigDecimal obj2) {
|
||||
if (obj1 == null || obj2 == null) {
|
||||
if (Objects.equals(obj1, obj2)) { return true; }
|
||||
if (Objects.compare(obj1,obj2, Comparator.nullsFirst(Comparator.naturalOrder())) == 0 ? Boolean.TRUE:Boolean.FALSE){ return true; }
|
||||
return false;
|
||||
}
|
||||
return obj1.compareTo(obj2) == 0;
|
||||
|
||||
+1
-1
@@ -2834,7 +2834,7 @@ public class Loan extends AbstractPersistableCustom {
|
||||
this.actualDisbursementDate = null;
|
||||
this.disbursedBy = null;
|
||||
boolean isDisbursedAmountChanged =
|
||||
!this.approvedPrincipal.equals(this.loanRepaymentScheduleDetail.getPrincipal().getAmount());
|
||||
approvedPrincipal.compareTo(this.loanRepaymentScheduleDetail.getPrincipal().getAmount()) == 0 ? Boolean.FALSE:Boolean.TRUE;
|
||||
this.loanRepaymentScheduleDetail.setPrincipal(this.approvedPrincipal);
|
||||
if (this.loanProduct.isMultiDisburseLoan()) {
|
||||
for (final LoanDisbursementDetails details : this.disbursementDetails) {
|
||||
|
||||
+2
-2
@@ -2959,7 +2959,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
private void checkIfLoanIsPaidInAdvance(final Long loanId, final BigDecimal transactionAmount) {
|
||||
BigDecimal overpaid = this.loanReadPlatformService.retrieveTotalPaidInAdvance(loanId).getPaidInAdvance();
|
||||
|
||||
if (overpaid == null || overpaid.equals(new BigDecimal(0)) || transactionAmount.floatValue() > overpaid.floatValue()) {
|
||||
if (overpaid == null || overpaid.compareTo(BigDecimal.ZERO) == 0 ? Boolean.TRUE:Boolean.FALSE || transactionAmount.floatValue() > overpaid.floatValue()) {
|
||||
if (overpaid == null) {
|
||||
overpaid = BigDecimal.ZERO;
|
||||
}
|
||||
@@ -3105,4 +3105,4 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -746,7 +746,7 @@ public class FixedDepositAccount extends SavingsAccount {
|
||||
BigDecimal applicableInterestRate = this.chart.getApplicableInterestRate(depositAmount, depositStartDate(),
|
||||
calculateMaturityDate(), this.client);
|
||||
|
||||
if (applicableInterestRate.equals(BigDecimal.ZERO)) {
|
||||
if (applicableInterestRate.compareTo(BigDecimal.ZERO) == 0 ? Boolean.TRUE:Boolean.FALSE) {
|
||||
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode(
|
||||
"no.applicable.interest.rate.is.found.based.on.amount.and.deposit.period");
|
||||
}
|
||||
|
||||
+1
-1
@@ -1042,7 +1042,7 @@ public class RecurringDepositAccount extends SavingsAccount {
|
||||
BigDecimal applicableInterestRate = this.chart.getApplicableInterestRate(maturityAmount, depositStartDate(), maturityDate,
|
||||
this.client);
|
||||
|
||||
if (applicableInterestRate.equals(BigDecimal.ZERO)) {
|
||||
if (applicableInterestRate.compareTo(BigDecimal.ZERO) == 0 ? Boolean.TRUE:Boolean.FALSE) {
|
||||
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode(
|
||||
"no.applicable.interest.rate.is.found.based.on.amount.and.deposit.period");
|
||||
}
|
||||
|
||||
+1
-1
@@ -518,7 +518,7 @@ public class ShareAccount extends AbstractPersistableCustom {
|
||||
for (ShareAccountTransaction tran : this.shareAccountTransactions) {
|
||||
if (tran.getPurchasedDate().equals(transaction.getPurchasedDate())
|
||||
&& tran.getTotalShares().equals(transaction.getTotalShares())
|
||||
&& tran.getPurchasePrice().equals(transaction.getPurchasePrice())
|
||||
&& tran.getPurchasePrice().compareTo(transaction.getPurchasePrice()) == 0 ? Boolean.TRUE:Boolean.FALSE
|
||||
&& tran.getTransactionStatus().equals(transaction.getTransactionStatus())
|
||||
&& tran.getTransactionType().equals(transaction.getTransactionType())) {
|
||||
returnTrans = tran;
|
||||
|
||||
+2
-2
@@ -248,7 +248,7 @@ public class ShareProduct extends AbstractAuditableCustom {
|
||||
|
||||
public boolean setUnitPrice(BigDecimal unitPrice) {
|
||||
boolean returnValue = false;
|
||||
if (!this.unitPrice.equals(unitPrice)) {
|
||||
if (this.unitPrice.compareTo(unitPrice) == 0 ? Boolean.FALSE:Boolean.TRUE) {
|
||||
this.unitPrice = unitPrice;
|
||||
returnValue = true;
|
||||
}
|
||||
@@ -363,7 +363,7 @@ public class ShareProduct extends AbstractAuditableCustom {
|
||||
|
||||
public boolean setshareCapitalValue(BigDecimal shareCapitalValue) {
|
||||
boolean updated = false;
|
||||
if (this.shareCapital == null || !this.shareCapital.equals(shareCapitalValue)) {
|
||||
if (this.shareCapital == null || this.shareCapital.compareTo(shareCapitalValue) == 0 ? Boolean.FALSE:Boolean.TRUE) {
|
||||
this.shareCapital = shareCapitalValue;
|
||||
updated = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user