Merge pull request #972 from percyashu/errorprone_variableNameSameAsType

FINERACT-822 enable variableNameSameAsType warning
This commit is contained in:
Michael Vorburger ⛑️
2020-06-03 22:13:56 +02:00
committed by GitHub
6 changed files with 19 additions and 17 deletions
+5 -3
View File
@@ -303,8 +303,8 @@ tasks.withType(JavaCompile) {
options.errorprone { options.errorprone {
disableWarningsInGeneratedCode = true disableWarningsInGeneratedCode = true
//Todo Remove necessary checks from this list //Todo Remove necessary checks from this list
disable("UnusedVariable", disable(
"VariableNameSameAsType", "UnusedVariable",
"InconsistentCapitalization", "InconsistentCapitalization",
"UnnecessaryParentheses", "UnnecessaryParentheses",
"ClassCanBeStatic", "ClassCanBeStatic",
@@ -333,10 +333,12 @@ tasks.withType(JavaCompile) {
"OperatorPrecedence" "OperatorPrecedence"
) )
//TODO gradually enable these checks //TODO gradually enable these checks
error( "DefaultCharset", error(
"DefaultCharset",
"RemoveUnusedImports", "RemoveUnusedImports",
"WaitNotInLoop", "WaitNotInLoop",
"ThreeLetterTimeZoneID", "ThreeLetterTimeZoneID",
"VariableNameSameAsType",
// "ReturnMissingNullable", // "ReturnMissingNullable",
// "InconsistentOverloads", // "InconsistentOverloads",
// "MethodCanBeStatic", // "MethodCanBeStatic",
@@ -432,7 +432,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
private JobKey constructJobKey(final String Key) { private JobKey constructJobKey(final String Key) {
final String[] keyParams = Key.split(SchedulerServiceConstants.JOB_KEY_SEPERATOR); final String[] keyParams = Key.split(SchedulerServiceConstants.JOB_KEY_SEPERATOR);
final JobKey JobKey = new JobKey(keyParams[0], keyParams[1]); final JobKey jobKey = new JobKey(keyParams[0], keyParams[1]);
return JobKey; return jobKey;
} }
} }
@@ -70,8 +70,8 @@ public enum RepaymentRescheduleType {
} }
public static RepaymentRescheduleType fromInt(final int i) { public static RepaymentRescheduleType fromInt(final int i) {
final RepaymentRescheduleType RepaymentRescheduleType = intToEnumMap.get(Integer.valueOf(i)); final RepaymentRescheduleType repaymentRescheduleType = intToEnumMap.get(Integer.valueOf(i));
return RepaymentRescheduleType; return repaymentRescheduleType;
} }
public static int getMinValue() { public static int getMinValue() {
@@ -137,16 +137,16 @@ public class CollateralsApiResource {
@PathParam("collateralId") @ApiParam(value = "collateralId") final Long CollateralId) { @PathParam("collateralId") @ApiParam(value = "collateralId") final Long CollateralId) {
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
CollateralData CollateralData = this.collateralReadPlatformService.retrieveCollateral(loanId, CollateralId); CollateralData collateralData = this.collateralReadPlatformService.retrieveCollateral(loanId, CollateralId);
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
if (settings.isTemplate()) { if (settings.isTemplate()) {
final Collection<CodeValueData> codeValues = this.codeValueReadPlatformService final Collection<CodeValueData> codeValues = this.codeValueReadPlatformService
.retrieveCodeValuesByCode(CollateralApiConstants.COLLATERAL_CODE_NAME); .retrieveCodeValuesByCode(CollateralApiConstants.COLLATERAL_CODE_NAME);
CollateralData = CollateralData.template(CollateralData, codeValues); collateralData = collateralData.template(collateralData, codeValues);
} }
return this.apiJsonSerializerService.serialize(settings, CollateralData, RESPONSE_DATA_PARAMETERS); return this.apiJsonSerializerService.serialize(settings, collateralData, RESPONSE_DATA_PARAMETERS);
} }
@POST @POST
@@ -26,7 +26,7 @@ public interface DepositAccountInterestRateChartReadPlatformService {
DepositAccountInterestRateChartData retrieveOneWithSlabs(Long interestChartId); DepositAccountInterestRateChartData retrieveOneWithSlabs(Long interestChartId);
DepositAccountInterestRateChartData retrieveWithTemplate(DepositAccountInterestRateChartData DepositAccountInterestRateChartData); DepositAccountInterestRateChartData retrieveWithTemplate(DepositAccountInterestRateChartData depositAccountInterestRateChartData);
DepositAccountInterestRateChartData retrieveOneWithSlabsOnAccountId(Long accountId); DepositAccountInterestRateChartData retrieveOneWithSlabsOnAccountId(Long accountId);
@@ -42,13 +42,13 @@ import org.springframework.stereotype.Component;
public class ShareProductDividendAssembler { public class ShareProductDividendAssembler {
private final ProductReadPlatformService shareProductReadPlatformService; private final ProductReadPlatformService shareProductReadPlatformService;
private final ShareAccountReadPlatformService ShareAccountReadPlatformService; private final ShareAccountReadPlatformService shareAccountReadPlatformService;
@Autowired @Autowired
public ShareProductDividendAssembler(final ShareProductReadPlatformServiceImpl shareProductReadPlatformService, public ShareProductDividendAssembler(final ShareProductReadPlatformServiceImpl shareProductReadPlatformService,
final ShareAccountReadPlatformService ShareAccountReadPlatformService) { final ShareAccountReadPlatformService shareAccountReadPlatformService) {
this.shareProductReadPlatformService = shareProductReadPlatformService; this.shareProductReadPlatformService = shareProductReadPlatformService;
this.ShareAccountReadPlatformService = ShareAccountReadPlatformService; this.shareAccountReadPlatformService = shareAccountReadPlatformService;
} }
public ShareProductDividendPayOutDetails calculateDividends(final Long productId, final BigDecimal amount, public ShareProductDividendPayOutDetails calculateDividends(final Long productId, final BigDecimal amount,
@@ -57,7 +57,7 @@ public class ShareProductDividendAssembler {
ShareProductData product = (ShareProductData) this.shareProductReadPlatformService.retrieveOne(productId, false); ShareProductData product = (ShareProductData) this.shareProductReadPlatformService.retrieveOne(productId, false);
MonetaryCurrency currency = new MonetaryCurrency(product.getCurrency().code(), product.getCurrency().decimalPlaces(), product MonetaryCurrency currency = new MonetaryCurrency(product.getCurrency().code(), product.getCurrency().decimalPlaces(), product
.getCurrency().currencyInMultiplesOf()); .getCurrency().currencyInMultiplesOf());
Collection<ShareAccountData> shareAccountDatas = this.ShareAccountReadPlatformService.retrieveAllShareAccountDataForDividends( Collection<ShareAccountData> shareAccountDatas = this.shareAccountReadPlatformService.retrieveAllShareAccountDataForDividends(
productId, product.getAllowDividendCalculationForInactiveClients(), dividendPeriodStartDate); productId, product.getAllowDividendCalculationForInactiveClients(), dividendPeriodStartDate);
if(shareAccountDatas == null || shareAccountDatas.isEmpty()) { if(shareAccountDatas == null || shareAccountDatas.isEmpty()) {
throw new ShareAccountsNotFoundException(product.getId()) ; throw new ShareAccountsNotFoundException(product.getId()) ;