fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vorbur...@apache.org
Subject [fineract] branch develop updated: FINERACT-821 Added and Enforced WhitespaceAround Checkstyle
Date Sun, 14 Jun 2020 21:01:19 GMT
This is an automated email from the ASF dual-hosted git repository.

vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new f6f1af9  FINERACT-821 Added and Enforced WhitespaceAround Checkstyle
f6f1af9 is described below

commit f6f1af9e956da54a877a48193e2db97765272b76
Author: thesmallstar <manthan.surkar@gmail.com>
AuthorDate: Mon Jun 15 01:28:37 2020 +0530

    FINERACT-821 Added and Enforced WhitespaceAround Checkstyle
---
 fineract-provider/config/checkstyle/checkstyle.xml  | 21 +++++++++++----------
 .../fineract/portfolio/charge/domain/Charge.java    |  3 ++-
 .../loanaccount/service/LoanUtilService.java        |  6 +++---
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/fineract-provider/config/checkstyle/checkstyle.xml b/fineract-provider/config/checkstyle/checkstyle.xml
index d9022f0..11e79cd 100644
--- a/fineract-provider/config/checkstyle/checkstyle.xml
+++ b/fineract-provider/config/checkstyle/checkstyle.xml
@@ -127,6 +127,16 @@
             <message key="name.invalidPattern"
              value="Method name ''{0}'' must match pattern ''{1}''."/>
         </module>
+            <module name="WhitespaceAround">
+            <property name="allowEmptyConstructors" value="true"/>
+            <property name="allowEmptyMethods" value="true"/>
+            <property name="allowEmptyTypes" value="true"/>
+            <property name="allowEmptyLoops" value="true"/>
+            <message key="ws.notFollowed"
+             value="WhitespaceAround: ''{0}'' is not followed by whitespace."/>
+             <message key="ws.notPreceded"
+             value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
+        </module>
 <!-- TODO Enable many more checks (go about this one by one, step by step, raise separate
PRs fixing and then enforcing):
 
         <module name="HiddenField">
@@ -157,16 +167,7 @@
             <property name="option" value="alone"/>
             <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR,
STATIC_INIT, INSTANCE_INIT"/>
         </module>
-        <module name="WhitespaceAround">
-            <property name="allowEmptyConstructors" value="true"/>
-            <property name="allowEmptyMethods" value="true"/>
-            <property name="allowEmptyTypes" value="true"/>
-            <property name="allowEmptyLoops" value="true"/>
-            <message key="ws.notFollowed"
-             value="WhitespaceAround: ''{0}'' is not followed by whitespace."/>
-             <message key="ws.notPreceded"
-             value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
-        </module>
+
         <module name="ParenPad" />
 
         <module name="MultipleVariableDeclarations"/>
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java
index 871b2f7..c137a14 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java
@@ -393,7 +393,8 @@ public class Charge extends AbstractPersistableCustom {
             }
         }
 
-        if (isLoanCharge()) {// validate only for loan charge
+        // validate only for loan charge
+        if (isLoanCharge()) {
             final String paymentModeParamName = "chargePaymentMode";
             if (command.isChangeInIntegerParameterNamed(paymentModeParamName, this.chargePaymentMode))
{
                 final Integer newValue = command.integerValueOfParameterNamed(paymentModeParamName);
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanUtilService.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanUtilService.java
index d5c9b73..87c644f 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanUtilService.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanUtilService.java
@@ -225,7 +225,7 @@ public class LoanUtilService {
     private LocalDate calculateRepaymentStartingFromDate(final LocalDate actualDisbursementDate,
final Loan loan, final Calendar calendar,
             final CalendarHistoryDataWrapper calendarHistoryDataWrapper) {
         LocalDate calculatedRepaymentsStartingFromDate = loan.getExpectedFirstRepaymentOnDate();
-        if (calendar != null) {// sync repayments
+        if (calendar != null) { // sync repayments
 
             if (calculatedRepaymentsStartingFromDate == null && !calendar.getCalendarHistory().isEmpty()
                     && calendarHistoryDataWrapper != null) {
@@ -243,8 +243,8 @@ public class LoanUtilService {
                 // need to have minimum number of days gap between disbursement
                 // and first repayment date.
                 final LoanProductRelatedDetail repaymentScheduleDetails = loan.repaymentScheduleDetail();
-                if (repaymentScheduleDetails != null) {// Not expecting to be
-                                                       // null
+                // Not expecting to be null
+                if (repaymentScheduleDetails != null) {
                     final Integer repayEvery = repaymentScheduleDetails.getRepayEvery();
                     final String frequency = CalendarUtils
                             .getMeetingFrequencyFromPeriodFrequencyType(repaymentScheduleDetails.getRepaymentPeriodFrequencyType());


Mime
View raw message