INERACT-821 Added and Enforced EmptyBlock Checkstyle

This commit is contained in:
Manthan Surkar
2020-06-11 23:50:04 +02:00
committed by Michael Vorburger ⛑️
parent 8a1863b3b9
commit 885a501c64
6 changed files with 16 additions and 20 deletions
@@ -104,6 +104,10 @@
<property name="allowEscapesForControlCharacters" value="true"/> <property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/> <property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" 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>
<module name="UpperEll"/> <module name="UpperEll"/>
<module name="NeedBraces"/> <module name="NeedBraces"/>
@@ -144,10 +148,6 @@
<module name="OuterTypeFilename"/> <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="LeftCurly" />
<module name="RightCurly"> <module name="RightCurly">
@@ -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.constants.SmsCampaignTriggerType;
import org.apache.fineract.infrastructure.campaigns.sms.data.SmsProviderData; import org.apache.fineract.infrastructure.campaigns.sms.data.SmsProviderData;
import org.apache.fineract.infrastructure.core.data.EnumOptionData; 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.domain.CalendarWeekDaysType;
import org.apache.fineract.portfolio.calendar.service.CalendarEnumerations; import org.apache.fineract.portfolio.calendar.service.CalendarEnumerations;
import org.apache.fineract.portfolio.common.domain.PeriodFrequencyType; import org.apache.fineract.portfolio.common.domain.PeriodFrequencyType;
@@ -70,19 +71,18 @@ public class SmsCampaignDropdownReadPlatformServiceImpl implements SmsCampaignDr
public Collection<SmsProviderData> retrieveSmsProviders() { public Collection<SmsProviderData> retrieveSmsProviders() {
Collection<SmsProviderData> smsProviderOptions = new ArrayList<>(); Collection<SmsProviderData> smsProviderOptions = new ArrayList<>();
String hostName = "" ; String hostName = "" ;
try {
Map<String, Object> hostConfig = this.smsConfigUtils.getMessageGateWayRequestURI("smsbridges", null); Map<String, Object> hostConfig = this.smsConfigUtils.getMessageGateWayRequestURI("smsbridges", null);
URI uri = (URI) hostConfig.get("uri"); URI uri = (URI) hostConfig.get("uri");
hostName = uri.getHost() ; hostName = uri.getHost() ;
HttpEntity<?> entity = (HttpEntity<?>) hostConfig.get("entity"); HttpEntity<?> entity = (HttpEntity<?>) hostConfig.get("entity");
ResponseEntity<Collection<SmsProviderData>> responseOne = restTemplate.exchange(uri, HttpMethod.GET, entity, ResponseEntity<Collection<SmsProviderData>> responseOne = restTemplate.exchange(uri, HttpMethod.GET, entity,
new ParameterizedTypeReference<Collection<SmsProviderData>>() {}); 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(); smsProviderOptions = responseOne.getBody();
if (!responseOne.getStatusCode().equals(HttpStatus.OK)) { return smsProviderOptions;
}
} catch (Exception e) {
}
return smsProviderOptions;
} }
@Override @Override
@@ -114,11 +114,6 @@ public class XBRLBuilder {
if (dims.length == 2) { if (dims.length == 2) {
context = new ContextData(dims[0], dims[1], taxonomy.getType()); context = new ContextData(dims[0], dims[1], taxonomy.getType());
if (this.contextMap.containsKey(context)) {
} else {
}
} }
} }
@@ -245,9 +245,10 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService {
extraCriteria.append(" and s.is_active = 1 "); extraCriteria.append(" and s.is_active = 1 ");
} else if (status.equalsIgnoreCase("inActive")) { } else if (status.equalsIgnoreCase("inActive")) {
extraCriteria.append(" and s.is_active = 0 "); 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"}); 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. //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.
@@ -261,8 +261,10 @@ public class TellerManagementReadPlatformServiceImpl implements TellerManagement
extraCriteria.append(" and status = 300 "); extraCriteria.append(" and status = 300 ");
} else if (status.equalsIgnoreCase("inActive")) { } else if (status.equalsIgnoreCase("inActive")) {
extraCriteria.append(" and status = 0 "); 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" }); throw new UnrecognizedQueryParamException("status", status, new Object[] { "all", "active", "inactive" });
}
} }
if (StringUtils.isNotBlank(extraCriteria.toString())) { if (StringUtils.isNotBlank(extraCriteria.toString())) {
@@ -197,8 +197,6 @@ public class AccountTransfersWritePlatformServiceImpl implements AccountTransfer
this.accountTransferDetailRepository.saveAndFlush(accountTransferDetails); this.accountTransferDetailRepository.saveAndFlush(accountTransferDetails);
transferDetailId = accountTransferDetails.getId(); transferDetailId = accountTransferDetails.getId();
} else {
} }
final CommandProcessingResultBuilder builder = new CommandProcessingResultBuilder().withEntityId(transferDetailId); final CommandProcessingResultBuilder builder = new CommandProcessingResultBuilder().withEntityId(transferDetailId);