fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [fineract] vorburger commented on a change in pull request #987: FINERACT-822 enable OperatorPrecedence error
Date Sun, 07 Jun 2020 11:25:04 GMT

vorburger commented on a change in pull request #987:
URL: https://github.com/apache/fineract/pull/987#discussion_r436352278



##########
File path: fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationProperty.java
##########
@@ -114,8 +114,8 @@ public Date getDateValue(){
 
         final String passwordPropertyName = "force-password-reset-days";
         if (this.name.equalsIgnoreCase(passwordPropertyName)) {
-            if (this.enabled == true && command.hasParameter(valueParamName) &&
this.value == 0 || this.enabled == true
-                    && !command.hasParameter(valueParamName) && previousValue
== 0) { throw new ForcePasswordResetException(); }
+            if (((this.enabled == true) && command.hasParameter(valueParamName) &&
(this.value == 0)) || ((this.enabled == true)
+                    && !command.hasParameter(valueParamName) && (previousValue
== 0))) { throw new ForcePasswordResetException(); }

Review comment:
       Wait, this looks weird to me, shouldn't this just be:
   
   ```suggestion
               if ((this.enabled == true && command.hasParameter(valueParamName) &&
this.value == 0) || (this.enabled == true
                       && !command.hasParameter(valueParamName) && previousValue
== 0)) { throw new ForcePasswordResetException(); }
   ```

##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
##########
@@ -2384,7 +2384,7 @@ public ChangedTransactionDetail disburse(final AppUser currentUser,
final JsonCo
          **/
 
         if (isNoneOrCashOrUpfrontAccrualAccountingEnabledOnLoanProduct()
-                        && (isMultiDisburmentLoan() && getDisbursedLoanDisbursementDetails().size()
== 1 || !isMultiDisburmentLoan())) {
+                        && ((isMultiDisburmentLoan() && getDisbursedLoanDisbursementDetails().size()
== 1) || !isMultiDisburmentLoan())) {

Review comment:
       Wouldn't this be better & clearer like this, instead:
   
       if ((isNoneOrCashOrUpfrontAccrualAccountingEnabledOnLoanProduct()
           && isMultiDisburmentLoan() && getDisbursedLoanDisbursementDetails().size()
== 1) || !isMultiDisburmentLoan()) {
   




----------------------------------------------------------------
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:
users@infra.apache.org



Mime
View raw message