chore(deps): update dependency com.github.spotbugs:spotbugs to v4.2.0
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
8d16c8d8c3
commit
ff52192f66
+5
-5
@@ -399,7 +399,7 @@ public class DataValidatorBuilder {
|
||||
}
|
||||
|
||||
if (this.value != null) {
|
||||
final BigDecimal number = BigDecimal.valueOf(Double.valueOf(this.value.toString()));
|
||||
final BigDecimal number = BigDecimal.valueOf(Double.parseDouble(this.value.toString()));
|
||||
if (number.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".not.greater.than.zero");
|
||||
@@ -422,7 +422,7 @@ public class DataValidatorBuilder {
|
||||
}
|
||||
|
||||
if (this.value != null) {
|
||||
final BigDecimal number = BigDecimal.valueOf(Double.valueOf(this.value.toString()));
|
||||
final BigDecimal number = BigDecimal.valueOf(Double.parseDouble(this.value.toString()));
|
||||
if (number.compareTo(BigDecimal.ZERO) < 0) {
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".not.zero.or.greater");
|
||||
@@ -806,7 +806,7 @@ public class DataValidatorBuilder {
|
||||
|
||||
public DataValidatorBuilder inMinAndMaxAmountRange(final BigDecimal minimumAmount, final BigDecimal maximumAmount) {
|
||||
if (minimumAmount != null && maximumAmount != null && this.value != null) {
|
||||
final BigDecimal amount = BigDecimal.valueOf(Double.valueOf(this.value.toString()));
|
||||
final BigDecimal amount = BigDecimal.valueOf(Double.parseDouble(this.value.toString()));
|
||||
if (amount.compareTo(minimumAmount) < 0 || amount.compareTo(maximumAmount) > 0) {
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".amount.is.not.within.min.max.range");
|
||||
@@ -824,7 +824,7 @@ public class DataValidatorBuilder {
|
||||
|
||||
public DataValidatorBuilder notLessThanMin(final BigDecimal min) {
|
||||
if (min != null && this.value != null) {
|
||||
final BigDecimal amount = BigDecimal.valueOf(Double.valueOf(this.value.toString()));
|
||||
final BigDecimal amount = BigDecimal.valueOf(Double.parseDouble(this.value.toString()));
|
||||
if (amount.compareTo(min) < 0) {
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".is.less.than.min");
|
||||
@@ -841,7 +841,7 @@ public class DataValidatorBuilder {
|
||||
|
||||
public DataValidatorBuilder notGreaterThanMax(final BigDecimal max) {
|
||||
if (max != null && this.value != null) {
|
||||
final BigDecimal amount = BigDecimal.valueOf(Double.valueOf(this.value.toString()));
|
||||
final BigDecimal amount = BigDecimal.valueOf(Double.parseDouble(this.value.toString()));
|
||||
if (amount.compareTo(max) > 0) {
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".is.greater.than.max");
|
||||
|
||||
+2
-2
@@ -1811,8 +1811,8 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
||||
}
|
||||
|
||||
if ("DECIMAL".equalsIgnoreCase(colType)) {
|
||||
final BigDecimal currentDecimal = BigDecimal.valueOf(Double.valueOf(currValue));
|
||||
final BigDecimal newDecimal = BigDecimal.valueOf(Double.valueOf(pValue));
|
||||
final BigDecimal currentDecimal = BigDecimal.valueOf(Double.parseDouble(currValue));
|
||||
final BigDecimal newDecimal = BigDecimal.valueOf(Double.parseDouble(pValue));
|
||||
|
||||
return currentDecimal.compareTo(newDecimal) != 0;
|
||||
}
|
||||
|
||||
+3
-3
@@ -87,13 +87,13 @@ public class DefaultPaymentPeriodsInOneYearCalculator implements PaymentPeriodsI
|
||||
fraction = numberOfDaysInterestCalculationGrace.doubleValue() * every.doubleValue();
|
||||
break;
|
||||
case WEEKS:
|
||||
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.valueOf("7.0") * every.doubleValue());
|
||||
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.parseDouble("7.0") * every.doubleValue());
|
||||
break;
|
||||
case MONTHS:
|
||||
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.valueOf("30.0") * every.doubleValue());
|
||||
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.parseDouble("30.0") * every.doubleValue());
|
||||
break;
|
||||
case YEARS:
|
||||
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.valueOf("365.0") * every.doubleValue());
|
||||
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.parseDouble("365.0") * every.doubleValue());
|
||||
break;
|
||||
case INVALID:
|
||||
fraction = Double.valueOf("0");
|
||||
|
||||
+5
-5
@@ -764,7 +764,7 @@ public final class LoanApplicationTerms {
|
||||
|
||||
private BigDecimal calculateFlatInterestRateForLoanTerm(final PaymentPeriodsInOneYearCalculator calculator, final MathContext mc) {
|
||||
|
||||
final BigDecimal divisor = BigDecimal.valueOf(Double.valueOf("100.0"));
|
||||
final BigDecimal divisor = BigDecimal.valueOf(Double.parseDouble("100.0"));
|
||||
|
||||
final long loanTermPeriodsInOneYear = calculatePeriodsInOneYear(calculator);
|
||||
final BigDecimal loanTermPeriodsInYearBigDecimal = BigDecimal.valueOf(loanTermPeriodsInOneYear);
|
||||
@@ -1004,7 +1004,7 @@ public final class LoanApplicationTerms {
|
||||
|
||||
final long loanTermPeriodsInOneYear = calculatePeriodsInOneYear(calculator);
|
||||
|
||||
final BigDecimal divisor = BigDecimal.valueOf(Double.valueOf("100.0"));
|
||||
final BigDecimal divisor = BigDecimal.valueOf(Double.parseDouble("100.0"));
|
||||
final BigDecimal loanTermPeriodsInYearBigDecimal = BigDecimal.valueOf(loanTermPeriodsInOneYear);
|
||||
|
||||
BigDecimal periodicInterestRate = BigDecimal.ZERO;
|
||||
@@ -1088,7 +1088,7 @@ public final class LoanApplicationTerms {
|
||||
repaymentEvery = getPeriodsBetween(fromDate, toDate);
|
||||
}
|
||||
|
||||
final BigDecimal divisor = BigDecimal.valueOf(Double.valueOf("100.0"));
|
||||
final BigDecimal divisor = BigDecimal.valueOf(Double.parseDouble("100.0"));
|
||||
final BigDecimal loanTermPeriodsInYearBigDecimal = BigDecimal.valueOf(loanTermPeriodsInOneYear);
|
||||
final BigDecimal oneDayOfYearInterestRate = this.annualNominalInterestRate.divide(loanTermPeriodsInYearBigDecimal, mc)
|
||||
.divide(divisor, mc);
|
||||
@@ -1265,7 +1265,7 @@ public final class LoanApplicationTerms {
|
||||
interest = interest.zero();
|
||||
fraction = fraction - Integer.valueOf(1).doubleValue();
|
||||
|
||||
} else if (interestCalculationGraceOnRepaymentPeriodFraction > Double.valueOf("0.25")
|
||||
} else if (interestCalculationGraceOnRepaymentPeriodFraction > Double.parseDouble("0.25")
|
||||
&& interestCalculationGraceOnRepaymentPeriodFraction < Integer.valueOf(1).doubleValue()) {
|
||||
|
||||
final Money graceOnInterestForRepaymentPeriod = interest.multipliedBy(interestCalculationGraceOnRepaymentPeriodFraction);
|
||||
@@ -1278,7 +1278,7 @@ public final class LoanApplicationTerms {
|
||||
}
|
||||
|
||||
private boolean isInterestFreeGracePeriodFromDate(final double interestCalculationGraceOnRepaymentPeriodFraction) {
|
||||
return this.interestChargedFromDate != null && interestCalculationGraceOnRepaymentPeriodFraction > Double.valueOf("0.0");
|
||||
return this.interestChargedFromDate != null && interestCalculationGraceOnRepaymentPeriodFraction > Double.parseDouble("0.0");
|
||||
}
|
||||
|
||||
private Money calculateEqualPrincipalDueForInstallment(final MathContext mc, final int periodNumber) {
|
||||
|
||||
+2
-2
@@ -141,12 +141,12 @@ public class LoanProductMinMaxConstraints {
|
||||
|
||||
public BigDecimal getMinNominalInterestRatePerPeriod() {
|
||||
return this.minNominalInterestRatePerPeriod == null ? null
|
||||
: BigDecimal.valueOf(Double.valueOf(this.minNominalInterestRatePerPeriod.stripTrailingZeros().toString()));
|
||||
: BigDecimal.valueOf(Double.parseDouble(this.minNominalInterestRatePerPeriod.stripTrailingZeros().toString()));
|
||||
}
|
||||
|
||||
public BigDecimal getMaxNominalInterestRatePerPeriod() {
|
||||
return this.maxNominalInterestRatePerPeriod == null ? null
|
||||
: BigDecimal.valueOf(Double.valueOf(this.maxNominalInterestRatePerPeriod.stripTrailingZeros().toString()));
|
||||
: BigDecimal.valueOf(Double.parseDouble(this.maxNominalInterestRatePerPeriod.stripTrailingZeros().toString()));
|
||||
}
|
||||
|
||||
public Integer getMinNumberOfRepayments() {
|
||||
|
||||
+2
-2
@@ -238,7 +238,7 @@ public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentSche
|
||||
@Override
|
||||
public BigDecimal getNominalInterestRatePerPeriod() {
|
||||
return this.nominalInterestRatePerPeriod == null ? null
|
||||
: BigDecimal.valueOf(Double.valueOf(this.nominalInterestRatePerPeriod.stripTrailingZeros().toString()));
|
||||
: BigDecimal.valueOf(Double.parseDouble(this.nominalInterestRatePerPeriod.stripTrailingZeros().toString()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -249,7 +249,7 @@ public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentSche
|
||||
@Override
|
||||
public BigDecimal getAnnualNominalInterestRate() {
|
||||
return this.annualNominalInterestRate == null ? null
|
||||
: BigDecimal.valueOf(Double.valueOf(this.annualNominalInterestRate.stripTrailingZeros().toString()));
|
||||
: BigDecimal.valueOf(Double.parseDouble(this.annualNominalInterestRate.stripTrailingZeros().toString()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ public final class TaxUtils {
|
||||
Map<TaxComponent, BigDecimal> map = new HashMap<>(3);
|
||||
if (amount != null) {
|
||||
final double amountVal = amount.doubleValue();
|
||||
double cent_percentage = Double.valueOf("100.0");
|
||||
double cent_percentage = Double.parseDouble("100.0");
|
||||
for (TaxGroupMappings groupMappings : taxGroupMappings) {
|
||||
if (groupMappings.occursOnDayFromAndUpToAndIncluding(date)) {
|
||||
TaxComponent component = groupMappings.getTaxComponent();
|
||||
@@ -80,7 +80,7 @@ public final class TaxUtils {
|
||||
if (amount != null && amount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
double percentageVal = 0;
|
||||
double amountVal = amount.doubleValue();
|
||||
double cent_percentage = Double.valueOf("100.0");
|
||||
double cent_percentage = Double.parseDouble("100.0");
|
||||
for (TaxGroupMappings groupMappings : taxGroupMappings) {
|
||||
if (groupMappings.occursOnDayFromAndUpToAndIncluding(date)) {
|
||||
TaxComponent component = groupMappings.getTaxComponent();
|
||||
|
||||
+12
-12
@@ -42,12 +42,12 @@ public final class LoanProductRelatedDetailTestHelper {
|
||||
public static LoanProductRelatedDetail createSettingsForEqualPrincipalAmortizationQuarterly() {
|
||||
|
||||
final MonetaryCurrency currency = new MonetaryCurrencyBuilder().withCode("USD").withDigitsAfterDecimal(2).build();
|
||||
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.valueOf("200000"));
|
||||
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.parseDouble("200000"));
|
||||
|
||||
// 2% per month, 24% per year
|
||||
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.valueOf("2"));
|
||||
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.parseDouble("2"));
|
||||
final PeriodFrequencyType interestPeriodFrequencyType = PeriodFrequencyType.MONTHS;
|
||||
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.valueOf("24"));
|
||||
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.parseDouble("24"));
|
||||
|
||||
final InterestMethod interestMethod = InterestMethod.DECLINING_BALANCE;
|
||||
final InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD;
|
||||
@@ -66,12 +66,12 @@ public final class LoanProductRelatedDetailTestHelper {
|
||||
|
||||
public static LoanProductRelatedDetail createSettingsForEqualInstallmentAmortizationQuarterly() {
|
||||
final MonetaryCurrency currency = new MonetaryCurrencyBuilder().withCode("USD").withDigitsAfterDecimal(2).build();
|
||||
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.valueOf("200000"));
|
||||
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.parseDouble("200000"));
|
||||
|
||||
// 2% per month, 24% per year
|
||||
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.valueOf("2"));
|
||||
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.parseDouble("2"));
|
||||
final PeriodFrequencyType interestPeriodFrequencyType = PeriodFrequencyType.MONTHS;
|
||||
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.valueOf("24"));
|
||||
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.parseDouble("24"));
|
||||
|
||||
final InterestMethod interestMethod = InterestMethod.DECLINING_BALANCE;
|
||||
final InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD;
|
||||
@@ -91,12 +91,12 @@ public final class LoanProductRelatedDetailTestHelper {
|
||||
public static LoanProductRelatedDetail createSettingsForFlatQuarterly(final AmortizationMethod amortizationMethod) {
|
||||
|
||||
final MonetaryCurrency currency = new MonetaryCurrencyBuilder().withCode("USD").withDigitsAfterDecimal(2).build();
|
||||
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.valueOf("200000"));
|
||||
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.parseDouble("200000"));
|
||||
|
||||
// 2% per month, 24% per year
|
||||
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.valueOf("2"));
|
||||
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.parseDouble("2"));
|
||||
final PeriodFrequencyType interestPeriodFrequencyType = PeriodFrequencyType.MONTHS;
|
||||
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.valueOf("24"));
|
||||
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.parseDouble("24"));
|
||||
|
||||
final InterestMethod interestMethod = InterestMethod.FLAT;
|
||||
final InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD;
|
||||
@@ -115,12 +115,12 @@ public final class LoanProductRelatedDetailTestHelper {
|
||||
public static LoanProductRelatedDetail createSettingsForIrregularFlatEveryFourMonths() {
|
||||
|
||||
final MonetaryCurrency currency = new MonetaryCurrencyBuilder().withCode("KSH").withDigitsAfterDecimal(0).build();
|
||||
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.valueOf("15000"));
|
||||
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.parseDouble("15000"));
|
||||
|
||||
// 2% per month, 24% per year
|
||||
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.valueOf("2"));
|
||||
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.parseDouble("2"));
|
||||
final PeriodFrequencyType interestPeriodFrequencyType = PeriodFrequencyType.MONTHS;
|
||||
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.valueOf("24"));
|
||||
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.parseDouble("24"));
|
||||
|
||||
final InterestMethod interestMethod = InterestMethod.FLAT;
|
||||
final InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD;
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public class MoneyBuilder {
|
||||
}
|
||||
|
||||
public MoneyBuilder with(final String withAmount) {
|
||||
this.newAmount = BigDecimal.valueOf(Double.valueOf(withAmount));
|
||||
this.newAmount = BigDecimal.valueOf(Double.parseDouble(withAmount));
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user