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: INERACT-821 Added and Enforced EmptyBlock Checkstyle
Date Thu, 11 Jun 2020 21:50:15 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 885a501  INERACT-821 Added and Enforced EmptyBlock Checkstyle
885a501 is described below

commit 885a501c647f53f04eff49f83535293995089ca9
Author: Manthan Surkar <manthan.surkar@gmail.com>
AuthorDate: Sun Jun 7 04:38:36 2020 +0530

    INERACT-821 Added and Enforced EmptyBlock Checkstyle
---
 fineract-provider/config/checkstyle/checkstyle.xml           |  8 ++++----
 .../service/SmsCampaignDropdownReadPlatformServiceImpl.java  | 12 ++++++------
 .../java/org/apache/fineract/mix/service/XBRLBuilder.java    |  5 -----
 .../staff/service/StaffReadPlatformServiceImpl.java          |  5 +++--
 .../service/TellerManagementReadPlatformServiceImpl.java     |  4 +++-
 .../service/AccountTransfersWritePlatformServiceImpl.java    |  2 --
 6 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/fineract-provider/config/checkstyle/checkstyle.xml b/fineract-provider/config/checkstyle/checkstyle.xml
index 7cda316..606c389 100644
--- a/fineract-provider/config/checkstyle/checkstyle.xml
+++ b/fineract-provider/config/checkstyle/checkstyle.xml
@@ -105,6 +105,10 @@
             <property name="allowByTailComment" value="true"/>
             <property name="allowNonPrintableEscapes" value="true"/>
         </module>
+        <module name="EmptyBlock">
+            <property name="option" value="TEXT"/>
+            <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
LITERAL_SWITCH"/>
+        </module>
           <module name="UpperEll"/>
           <module name="NeedBraces"/>
           <module name="ArrayTypeStyle"/>     
@@ -144,10 +148,6 @@
         <module name="OuterTypeFilename"/>
         
        
-        <module name="EmptyBlock">
-            <property name="option" value="TEXT"/>
-            <property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY,
LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
-        </module>
       
         <module name="LeftCurly" />
         <module name="RightCurly">
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDropdownReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDropdownReadPlatformServiceImpl.java
index 23357ea..7b568da 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDropdownReadPlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDropdownReadPlatformServiceImpl.java
@@ -30,6 +30,7 @@ import org.apache.fineract.infrastructure.campaigns.sms.constants.SmsCampaignEnu
 import org.apache.fineract.infrastructure.campaigns.sms.constants.SmsCampaignTriggerType;
 import org.apache.fineract.infrastructure.campaigns.sms.data.SmsProviderData;
 import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
 import org.apache.fineract.portfolio.calendar.domain.CalendarWeekDaysType;
 import org.apache.fineract.portfolio.calendar.service.CalendarEnumerations;
 import org.apache.fineract.portfolio.common.domain.PeriodFrequencyType;
@@ -70,19 +71,18 @@ public class SmsCampaignDropdownReadPlatformServiceImpl implements SmsCampaignDr
     public Collection<SmsProviderData> retrieveSmsProviders() {
         Collection<SmsProviderData> smsProviderOptions = new ArrayList<>();
         String hostName = "" ;
-        try {
             Map<String, Object> hostConfig = this.smsConfigUtils.getMessageGateWayRequestURI("smsbridges",
null);
             URI uri = (URI) hostConfig.get("uri");
             hostName = uri.getHost() ;
             HttpEntity<?> entity = (HttpEntity<?>) hostConfig.get("entity");
             ResponseEntity<Collection<SmsProviderData>> responseOne = restTemplate.exchange(uri,
HttpMethod.GET, entity,
                     new ParameterizedTypeReference<Collection<SmsProviderData>>()
{});
+             if (!responseOne.getStatusCode().equals(HttpStatus.OK)) {
+                throw new PlatformDataIntegrityException("error.msg.mobile.service.provider.not.available",
+                "Mobile service provider not available.");
+             }
             smsProviderOptions = responseOne.getBody();
-            if (!responseOne.getStatusCode().equals(HttpStatus.OK)) {
-            }
-        } catch (Exception e) {
-        }
-        return smsProviderOptions;
+            return smsProviderOptions;
     }
 
     @Override
diff --git a/fineract-provider/src/main/java/org/apache/fineract/mix/service/XBRLBuilder.java
b/fineract-provider/src/main/java/org/apache/fineract/mix/service/XBRLBuilder.java
index 40efd1d..0843a87 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/mix/service/XBRLBuilder.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/mix/service/XBRLBuilder.java
@@ -114,11 +114,6 @@ public class XBRLBuilder {
 
             if (dims.length == 2) {
                 context = new ContextData(dims[0], dims[1], taxonomy.getType());
-                if (this.contextMap.containsKey(context)) {
-
-                } else {
-
-                }
             }
         }
 
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformServiceImpl.java
index f76c4b1..4803cf8 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformServiceImpl.java
@@ -245,9 +245,10 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService
{
                 extraCriteria.append(" and s.is_active = 1 ");
             } else if (status.equalsIgnoreCase("inActive")) {
                 extraCriteria.append(" and s.is_active = 0 ");
-            } else if (status.equalsIgnoreCase("all")) {
-            } else {
+            } else{
+                if (!status.equalsIgnoreCase("all")) {
                 throw new UnrecognizedQueryParamException("status", status, new Object[]{"all",
"active", "inactive"});
+                }
             }
         }
         //adding the Authorization criteria so that a user cannot see an employee who does
not belong to his office or     a sub office for his office.
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java
index 583d900..d4f0127 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java
@@ -261,8 +261,10 @@ public class TellerManagementReadPlatformServiceImpl implements TellerManagement
             extraCriteria.append(" and status = 300 ");
         } else if (status.equalsIgnoreCase("inActive")) {
             extraCriteria.append(" and status = 0 ");
-        } else if (status.equalsIgnoreCase("all")) {} else {
+        } else {
+            if (!status.equalsIgnoreCase("all")){
             throw new UnrecognizedQueryParamException("status", status, new Object[] { "all",
"active", "inactive" });
+            }
         }
 
         if (StringUtils.isNotBlank(extraCriteria.toString())) {
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountTransfersWritePlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountTransfersWritePlatformServiceImpl.java
index 8905ab6..96b4ab4 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountTransfersWritePlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountTransfersWritePlatformServiceImpl.java
@@ -197,8 +197,6 @@ public class AccountTransfersWritePlatformServiceImpl implements AccountTransfer
             this.accountTransferDetailRepository.saveAndFlush(accountTransferDetails);
             transferDetailId = accountTransferDetails.getId();
 
-        } else {
-
         }
 
         final CommandProcessingResultBuilder builder = new CommandProcessingResultBuilder().withEntityId(transferDetailId);


Mime
View raw message