FINERACT-696
add spotbug bug-pattern plugin. Apply suggestions from code review closes https://issues.apache.org/jira/browse/FINERACT-696 Co-Authored-By: Michael Vorburger ⛑️ <mike@vorburger.ch>
This commit is contained in:
committed by
Michael Vorburger ⛑️
co-authored by
Michael Vorburger ⛑️
parent
de329e2489
commit
f484f884a0
@@ -39,14 +39,14 @@ buildscript {
|
||||
'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0',
|
||||
'org.zeroturnaround:gradle-jrebel-plugin:1.1.2',
|
||||
'org.springframework.boot:spring-boot-gradle-plugin:2.2.4.RELEASE'
|
||||
// below
|
||||
// below
|
||||
classpath "org.apache.openjpa:openjpa:$openJPAVersion"
|
||||
classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0'
|
||||
classpath 'gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.2'
|
||||
classpath "com.github.spotbugs:spotbugs-gradle-plugin:2.0.1"
|
||||
// Use Guava version 23+ as a workaround to spotbug intergration.
|
||||
// See: https://github.com/spotbugs/spotbugs-gradle-plugin/issues/128#issuecomment-535864882
|
||||
classpath 'com.google.guava:guava:28.1-jre'
|
||||
classpath "com.github.spotbugs:spotbugs-gradle-plugin:2.0.1"
|
||||
// Use Guava version 23+ as a workaround to spotbug intergration.
|
||||
// See: https://github.com/spotbugs/spotbugs-gradle-plugin/issues/128#issuecomment-535864882
|
||||
classpath 'com.google.guava:guava:28.1-jre'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ dependencyManagement {
|
||||
//dependency 'junit:junit-dep:4.11'
|
||||
dependency 'org.mockito:mockito-core:+'
|
||||
dependency 'com.jayway.restassured:rest-assured:2.3.3'
|
||||
dependency 'org.slf4j:slf4j-simple:1.7.30'
|
||||
dependency 'com.mockrunner:mockrunner-jms:2.0.1'
|
||||
dependency 'com.mockrunner:mockrunner-jdbc:2.0.1'
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ dependencies {
|
||||
tomcat "org.apache.tomcat:tomcat-dbcp"
|
||||
|
||||
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
|
||||
|
||||
spotbugsPlugins "jp.skypencil.findbugs.slf4j:bug-pattern:1.4.2@jar"
|
||||
|
||||
compile ("org.springframework.boot:spring-boot-starter-data-jpa") {
|
||||
exclude group: 'com.zaxxer', module: 'HikariCP'
|
||||
@@ -109,6 +111,7 @@ dependencies {
|
||||
testCompile 'junit:junit',
|
||||
//'junit:junit-dep',
|
||||
'org.mockito:mockito-core',
|
||||
'org.slf4j:slf4j-simple',
|
||||
'com.jayway.restassured:rest-assured',
|
||||
'com.mockrunner:mockrunner-jms',
|
||||
'com.google.code.gson:gson',
|
||||
|
||||
@@ -26,6 +26,8 @@ dependencies {
|
||||
|
||||
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
|
||||
|
||||
spotbugsPlugins "jp.skypencil.findbugs.slf4j:bug-pattern:1.4.2@jar"
|
||||
|
||||
api(
|
||||
'com.google.code.gson:gson',
|
||||
'org.quartz-scheduler:quartz',
|
||||
@@ -109,6 +111,7 @@ dependencies {
|
||||
testCompile 'junit:junit:4.11',
|
||||
//'junit:junit-dep:4.11',
|
||||
'org.mockito:mockito-core',
|
||||
'org.slf4j:slf4j-simple',
|
||||
'com.jayway.restassured:rest-assured',
|
||||
'com.mockrunner:mockrunner-jms',
|
||||
'com.google.code.gson:gson',
|
||||
|
||||
+2
-2
@@ -86,7 +86,7 @@ public class Utils {
|
||||
sleep(3);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("{} caused {}, going to wait and retry (attempt {})", HEALTH_URL, new Object[] { e.getMessage(), attempt++ });
|
||||
logger.info("{} caused {}, going to wait and retry (attempt {})", new Object[] { HEALTH_URL, e.getMessage(), attempt++ });
|
||||
lastException = e;
|
||||
sleep(3);
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class Utils {
|
||||
logger.error("{} still not reachable, giving up", HEALTH_URL, lastException);
|
||||
throw new AssertionError(HEALTH_URL + " not reachable", lastException);
|
||||
} else {
|
||||
logger.error("{} still has not returned HTTP 200, giving up; (last) body: ", HEALTH_URL, response.prettyPrint());
|
||||
logger.error("{} still has not returned HTTP 200, giving up (last) body: {}", HEALTH_URL, response.prettyPrint());
|
||||
fail(HEALTH_URL + " returned " + response.prettyPrint());
|
||||
}
|
||||
}
|
||||
|
||||
+21
-21
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
|
||||
@SuppressWarnings({ "rawtypes" })
|
||||
public class InteropHelper {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(InteropTest.class);
|
||||
private final static Logger log = LoggerFactory.getLogger(InteropHelper.class);
|
||||
|
||||
private static final String BASE_URL = "/fineract-provider/api/v1/interoperation";
|
||||
private static final String HEALTH_URL = BASE_URL + "/health";
|
||||
@@ -135,10 +135,10 @@ public class InteropHelper {
|
||||
*/
|
||||
public String getHealth() {
|
||||
String url = buildUrl(HEALTH_URL);
|
||||
log.debug("Calling Interoperable GET Health: " + url);
|
||||
log.debug("Calling Interoperable GET Health: {}", url);
|
||||
|
||||
String response = Utils.performServerGet(requestSpec, responseSpec, url, null);
|
||||
log.debug("Response Interoperable GET Health: " + response);
|
||||
log.debug("Response Interoperable GET Health: {}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -147,10 +147,10 @@ public class InteropHelper {
|
||||
*/
|
||||
public String getParty(InteropIdentifierType idType, String idValue) {
|
||||
String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue);
|
||||
log.debug("Calling Interoperable GET Party: " + url);
|
||||
log.debug("Calling Interoperable GET Party: {}", url);
|
||||
|
||||
String response = Utils.performServerGet(requestSpec, responseSpec, url, null);
|
||||
log.debug("Response Interoperable GET Party: " + response);
|
||||
log.debug("Response Interoperable GET Party: {}", response);
|
||||
return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID);
|
||||
}
|
||||
|
||||
@@ -160,10 +160,10 @@ public class InteropHelper {
|
||||
public String postParty(InteropIdentifierType idType, String idValue) {
|
||||
String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue);
|
||||
String request = buildPartiesJson();
|
||||
log.debug("Calling Interoperable POST Party: " + url + ", body: " + request);
|
||||
log.debug("Calling Interoperable POST Party: {}, body: {}", url, request);
|
||||
|
||||
String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null);
|
||||
log.debug("Response Interoperable POST Party: " + response);
|
||||
log.debug("Response Interoperable POST Party: {}", response);
|
||||
return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID);
|
||||
}
|
||||
|
||||
@@ -173,10 +173,10 @@ public class InteropHelper {
|
||||
public String deleteParty(InteropIdentifierType idType, String idValue) {
|
||||
String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue);
|
||||
String request = buildPartiesJson();
|
||||
log.debug("Calling Interoperable DELETE Party: " + url + ", body: " + request);
|
||||
log.debug("Calling Interoperable DELETE Party: {}, body: {}", url, request);
|
||||
|
||||
String response = Utils.performServerDelete(requestSpec, responseSpec, url, request, null);
|
||||
log.debug("Response Interoperable DELETE Party: " + response);
|
||||
log.debug("Response Interoperable DELETE Party: {}", response);
|
||||
return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID);
|
||||
}
|
||||
|
||||
@@ -191,10 +191,10 @@ public class InteropHelper {
|
||||
*/
|
||||
public String getTransactionRequest(String requestCode) {
|
||||
String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + REQUESTS_URL_PARAM + '/' + requestCode);
|
||||
log.debug("Calling Interoperable GET Request: " + url);
|
||||
log.debug("Calling Interoperable GET Request: {}", url);
|
||||
|
||||
String response = Utils.performServerGet(requestSpec, responseSpec, url, null);
|
||||
log.debug("Response Interoperable GET Request: " + response);
|
||||
log.debug("Response Interoperable GET Request: {}", response);
|
||||
return getJsonAttribute(response, InteropUtil.PARAM_REQUEST_CODE);
|
||||
}
|
||||
|
||||
@@ -205,10 +205,10 @@ public class InteropHelper {
|
||||
public String postTransactionRequest(String requestCode, InteropTransactionRole role) {
|
||||
String url = buildUrl(REQUESTS_URL);
|
||||
String request = buildTransactionRequestJson(requestCode, role);
|
||||
log.debug("Calling Interoperable POST Request: " + url + ", body: " + request);
|
||||
log.debug("Calling Interoperable POST Request: {}, body: {}", url, request);
|
||||
|
||||
String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null);
|
||||
log.debug("Response Interoperable POST Request: " + response);
|
||||
log.debug("Response Interoperable POST Request: {}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -238,10 +238,10 @@ public class InteropHelper {
|
||||
*/
|
||||
public String getQuote(String quoteCode) {
|
||||
String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + QUOTES_URL_PARAM + '/' + quoteCode);
|
||||
log.debug("Calling Interoperable GET Quote: " + url);
|
||||
log.debug("Calling Interoperable GET Quote: {}", url);
|
||||
|
||||
String response = Utils.performServerGet(requestSpec, responseSpec, url, null);
|
||||
log.debug("Response Interoperable GET Quote: " + response);
|
||||
log.debug("Response Interoperable GET Quote: {}", response);
|
||||
return getJsonAttribute(response, InteropUtil.PARAM_QUOTE_CODE);
|
||||
}
|
||||
|
||||
@@ -251,10 +251,10 @@ public class InteropHelper {
|
||||
public String postQuote(String quoteCode, InteropTransactionRole role) {
|
||||
String url = buildUrl(QUOTES_URL);
|
||||
String request = buildQuoteJson(quoteCode, role);
|
||||
log.debug("Calling Interoperable POST Quote: " + url + ", body: " + request);
|
||||
log.debug("Calling Interoperable POST Quote: {}, body: {}", url, request);
|
||||
|
||||
String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null);
|
||||
log.debug("Response Interoperable POST Quote: " + response);
|
||||
log.debug("Response Interoperable POST Quote: {}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -286,10 +286,10 @@ public class InteropHelper {
|
||||
*/
|
||||
public String getTransfer(String transferCode) {
|
||||
String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + TRANSFERS_URL_PARAM + '/' + transferCode);
|
||||
log.debug("Calling Interoperable GET Transfer: " + url);
|
||||
log.debug("Calling Interoperable GET Transfer: {}", url);
|
||||
|
||||
String response = Utils.performServerGet(requestSpec, responseSpec, url, null);
|
||||
log.debug("Response Interoperable GET Transfer: " + response);
|
||||
log.debug("Response Interoperable GET Transfer: {}", response);
|
||||
return getJsonAttribute(response, InteropUtil.PARAM_TRANSFER_CODE);
|
||||
}
|
||||
|
||||
@@ -313,10 +313,10 @@ public class InteropHelper {
|
||||
public String postTransfer(String transferCode, InteropTransferActionType action, InteropTransactionRole role) {
|
||||
String url = buildUrl(TRANSFERS_URL) + '&' + PARAM_TRANSFER_ACTION + '=' + action;
|
||||
String request = buildTransferJson(transferCode, role);
|
||||
log.debug("Calling Interoperable POST Transfer: " + url + ", body: " + request);
|
||||
log.debug("Calling Interoperable POST Transfer: {}, body: {}", url, request);
|
||||
|
||||
String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null);
|
||||
log.debug("Response Interoperable POST Transfer: " + response);
|
||||
log.debug("Response Interoperable POST Transfer: {}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -140,7 +140,7 @@ public class InteropTest {
|
||||
savingsProductId = SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
|
||||
Assert.assertNotNull(savingsProductId);
|
||||
|
||||
log.debug("Sucessfully created Interoperable Saving Product (id: " + savingsProductId + ")");
|
||||
log.debug("Sucessfully created Interoperable Saving Product (id: {})", savingsProductId);
|
||||
}
|
||||
|
||||
private void createCharge() {
|
||||
@@ -167,7 +167,7 @@ public class InteropTest {
|
||||
savingsAccountHelper.addChargesForSavings(savingsId, chargeId, false, interopHelper.getFee());
|
||||
}
|
||||
|
||||
log.debug("Sucessfully created Interoperable Saving Account (id: " + savingsId + ")");
|
||||
log.debug("Sucessfully created Interoperable Saving Account (id: {})", savingsId);
|
||||
}
|
||||
|
||||
private void testParties() {
|
||||
@@ -245,7 +245,7 @@ public class InteropTest {
|
||||
|
||||
// prepare
|
||||
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
|
||||
log.debug("Response Interoperable GET Saving: " + savings);
|
||||
log.debug("Response Interoperable GET Saving: {}", savings);
|
||||
savingsJson = JsonPath.from(savings);
|
||||
BigDecimal onHold2 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class);
|
||||
BigDecimal balance2 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class);
|
||||
@@ -263,7 +263,7 @@ public class InteropTest {
|
||||
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
|
||||
|
||||
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
|
||||
log.debug("Response Interoperable GET Saving: " + savings);
|
||||
log.debug("Response Interoperable GET Saving: {}", savings);
|
||||
savingsJson = JsonPath.from(savings);
|
||||
BigDecimal onHold3 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class);
|
||||
BigDecimal balance3 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class);
|
||||
@@ -277,7 +277,7 @@ public class InteropTest {
|
||||
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
|
||||
|
||||
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
|
||||
log.debug("Response Interoperable GET Saving: " + savings);
|
||||
log.debug("Response Interoperable GET Saving: {}", savings);
|
||||
savingsJson = JsonPath.from(savings);
|
||||
BigDecimal onHold4 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class);
|
||||
BigDecimal balance4 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class);
|
||||
|
||||
+1
-1
@@ -144,7 +144,7 @@ public class GLClosureWritePlatformServiceJpaRepositoryImpl implements GLClosure
|
||||
command.longValueOfParameterNamed(GLClosureJsonInputParams.OFFICE_ID.getValue()), new LocalDate(
|
||||
command.DateValueOfParameterNamed(GLClosureJsonInputParams.CLOSING_DATE.getValue()))); }
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.glClosure.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource GL Closure: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ public class FinancialActivityAccountWritePlatformServiceImpl implements Financi
|
||||
throw new DuplicateFinancialActivityAccountFoundException(financialActivityId);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.glAccount.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource GL Account: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ public class GLAccountWritePlatformServiceJpaRepositoryImpl implements GLAccount
|
||||
throw new GLAccountDuplicateException(glCode);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.glAccount.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource GL Account: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
|
||||
Date entityDate = this.jdbcTemplate.queryForObject(dateFinder, Date.class, officeId);
|
||||
updateRunningBalance(officeId, entityDate);
|
||||
} catch (EmptyResultDataAccessException e) {
|
||||
logger.debug("No results found for updation of office running balance with office id:" + officeId);
|
||||
logger.debug("No results found for updation of office running balance with office id: {}", officeId);
|
||||
}
|
||||
commandProcessingResultBuilder.withOfficeId(officeId);
|
||||
}
|
||||
|
||||
+1
-1
@@ -639,7 +639,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
|
||||
|
||||
private void handleJournalEntryDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
||||
final Throwable realCause = dve.getMostSpecificCause();
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.glJournalEntry.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource Journal Entry: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
|
||||
throw new AccountingRuleDuplicateException(command.stringValueOfParameterNamed(AccountingRuleJsonInputParams.NAME.getValue()));
|
||||
} else if (realCause.getMessage().contains("UNIQUE_ACCOUNT_RULE_TAGS")) { throw new AccountingRuleDuplicateException(); }
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.accounting.rule.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource Accounting Rule: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+4
-3
@@ -105,16 +105,17 @@ public class AdHocScheduledJobRunnerServiceImpl implements AdHocScheduledJobRunn
|
||||
.append(adhoc.getQuery());
|
||||
if (insertSqlBuilder.length() > 0) {
|
||||
final int result = this.jdbcTemplate.update(insertSqlBuilder.toString());
|
||||
logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by inserted: " + result);
|
||||
logger.info("{}: Results affected by inserted: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||
|
||||
this.jdbcTemplate.update("UPDATE m_adhoc SET last_run=? WHERE id=?", new Date(), adhoc.getId());
|
||||
}
|
||||
} else {
|
||||
logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Skipping execution of " + adhoc.getName() + ", scheduled for execution on " + next);
|
||||
logger.info("{}: Skipping execution of {}, scheduled for execution on {}",
|
||||
new Object[] { ThreadLocalContextUtil.getTenant().getName(), adhoc.getName(), next });
|
||||
}
|
||||
});
|
||||
}else{
|
||||
logger.info(ThreadLocalContextUtil.getTenant().getName() + "Nothing to update ");
|
||||
logger.info("{} Nothing to update", ThreadLocalContextUtil.getTenant().getName());
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ public class AdHocWritePlatformServiceJpaRepositoryImpl implements AdHocWritePla
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
||||
+2
-2
@@ -85,12 +85,12 @@ public class CommandHandlerProvider implements ApplicationContextAware {
|
||||
final String[] commandHandlerBeans = this.applicationContext.getBeanNamesForAnnotation(CommandType.class);
|
||||
if (ArrayUtils.isNotEmpty(commandHandlerBeans)) {
|
||||
for (final String commandHandlerName : commandHandlerBeans) {
|
||||
LOGGER.info("Register command handler '" + commandHandlerName + "' ...");
|
||||
LOGGER.info("Register command handler '{}' ...", commandHandlerName);
|
||||
final CommandType commandType = this.applicationContext.findAnnotationOnBean(commandHandlerName, CommandType.class);
|
||||
try {
|
||||
this.registeredHandlers.put(commandType.entity() + "|" + commandType.action(), commandHandlerName);
|
||||
} catch (final Throwable th) {
|
||||
LOGGER.error("Unable to register command handler '" + commandHandlerName + "'!", th);
|
||||
LOGGER.error("Unable to register command handler '{}'!", commandHandlerName, th);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -214,7 +214,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||
this.columnValidator.validateSqlInjection(sqlBuilder.toString(), parameters.limitSql());
|
||||
}
|
||||
|
||||
logger.info("sql: " + sqlBuilder.toString());
|
||||
logger.info("sql: {}", sqlBuilder);
|
||||
|
||||
final String sqlCountRows = "SELECT FOUND_ROWS()";
|
||||
return this.paginationHelper.fetchPage(this.jdbcTemplate, sqlCountRows, sqlBuilder.toString(), extraCriteria.getArguments(), rm);
|
||||
@@ -251,7 +251,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||
}
|
||||
sql += extraCriteria.getSQLTemplate();
|
||||
sql += groupAndOrderBySQL;
|
||||
logger.info("sql: " + sql);
|
||||
logger.info("sql: {}", sql);
|
||||
|
||||
return this.jdbcTemplate.query(sql, rm, extraCriteria.getArguments());
|
||||
}
|
||||
@@ -511,4 +511,4 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -96,14 +96,14 @@ public class PortfolioCommandSourceWritePlatformServiceImpl implements Portfolio
|
||||
result = this.processAndLogCommandService.processAndLogCommand(wrapper, command, isApprovedByChecker);
|
||||
numberOfRetries = maxNumberOfRetries + 1;
|
||||
} catch (CannotAcquireLockException | ObjectOptimisticLockingFailureException exception) {
|
||||
logger.info("The following command " + command.json() + " has been retried " + numberOfRetries + " time(s)");
|
||||
logger.info("The following command {} has been retried {} time(s)", command.json(), numberOfRetries);
|
||||
/***
|
||||
* Fail if the transaction has been retired for
|
||||
* maxNumberOfRetries
|
||||
**/
|
||||
if (numberOfRetries >= maxNumberOfRetries) {
|
||||
logger.warn("The following command " + command.json() + " has been retried for the max allowed attempts of "
|
||||
+ numberOfRetries + " and will be rolled back");
|
||||
logger.warn("The following command {} has been retried for the max allowed attempts of {} and will be rolled back",
|
||||
command.json(), numberOfRetries);
|
||||
throw (exception);
|
||||
}
|
||||
/***
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ public class AccountNumberFormatWritePlatformServiceJpaRepositoryImpl implements
|
||||
"Account Format preferences for Account type `" + entityAccountType.getCode() + "` already exists", "externalId",
|
||||
entityAccountType.getValue(), entityAccountType.getCode());
|
||||
}
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.account.number.format.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
+1
-1
@@ -293,7 +293,7 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
|
||||
LocalDateTime tenantDateNow = tenantDateTime();
|
||||
LocalDateTime nextTriggerDate = emailCampaignData.getNextTriggerDate().toLocalDateTime();
|
||||
|
||||
logger.info("tenant time " + tenantDateNow.toString() + " trigger time " + nextTriggerDate.toString());
|
||||
logger.info("tenant time {} trigger time {}", tenantDateNow, nextTriggerDate);
|
||||
if (nextTriggerDate.isBefore(tenantDateNow)) {
|
||||
insertDirectCampaignIntoEmailOutboundTable(emailCampaignData.getParamValue(), emailCampaignData.getEmailSubject(),
|
||||
emailCampaignData.getMessage(), emailCampaignData.getCampaignName(), emailCampaignData.getId());
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ public class EmailWritePlatformServiceJpaRepositoryImpl implements EmailWritePla
|
||||
if (realCause.getMessage().contains("email_address")) { throw new PlatformDataIntegrityException("error.msg.email.no.email.address.exists",
|
||||
"The group, client or staff provided has no email address.", "id"); }
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.email.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+4
-4
@@ -235,9 +235,9 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
|
||||
}
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
logger.error("smsParams does not contain the key: " + e.getMessage());
|
||||
logger.error("smsParams does not contain the key: ", e);
|
||||
} catch (final RuntimeException e) {
|
||||
logger.debug("Client Office Id and SMS Campaign Office id doesn't match");
|
||||
logger.debug("Client Office Id and SMS Campaign Office id doesn't match ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -293,9 +293,9 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
|
||||
this.smsMessageScheduledJobService.sendTriggeredMessages(smsDataMap);
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
logger.error("smsParams does not contain the key: " + e.getMessage());
|
||||
logger.error("smsParams does not contain the key: ", e);
|
||||
} catch (final RuntimeException e) {
|
||||
logger.debug("Client Office Id and SMS Campaign Office id doesn't match");
|
||||
logger.debug("Client Office Id and SMS Campaign Office id doesn't match ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-9
@@ -240,7 +240,7 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
||||
}
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
logger.error(e.getMessage());
|
||||
logger.error("Error occured.", e) ;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -302,9 +302,9 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
||||
}
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
logger.error(e.getMessage()) ;
|
||||
logger.error("Error occured.", e) ;
|
||||
} catch (final RuntimeException e) {
|
||||
logger.error(e.getMessage()) ;
|
||||
logger.error("Error occured.", e) ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,9 +347,9 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
||||
}
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
logger.error(e.getMessage()) ;
|
||||
logger.error("Error occured.", e) ;
|
||||
} catch (final RuntimeException e) {
|
||||
logger.error(e.getMessage()) ;
|
||||
logger.error("Error occured.", e) ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,9 +391,9 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
||||
}
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
logger.error(e.getMessage()) ;
|
||||
logger.error("Error occured.", e) ;
|
||||
} catch (final RuntimeException e) {
|
||||
logger.error(e.getMessage()) ;
|
||||
logger.error("Error occured.", e) ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
||||
final String response = this.genericDataService.generateJsonFromGenericResultsetData(results);
|
||||
resultList = new ObjectMapper().readValue(response, new TypeReference<List<HashMap<String, Object>>>() {});
|
||||
} catch (JsonParseException e) {
|
||||
logger.info("Conversion of report query results to JSON failed: " + e.getMessage() + " - Location: " + e.getLocation());
|
||||
logger.info("Conversion of report query results to JSON failed", e);
|
||||
return resultList;
|
||||
}
|
||||
// loop changes array date to string date
|
||||
@@ -656,7 +656,8 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
||||
LocalDateTime tenantDateNow = tenantDateTime();
|
||||
LocalDateTime nextTriggerDate = smsCampaign.getNextTriggerDate();
|
||||
|
||||
logger.info("tenant time " + tenantDateNow.toString() + " trigger time " + nextTriggerDate.toString() + JobName.UPDATE_SMS_OUTBOUND_WITH_CAMPAIGN_MESSAGE.name());
|
||||
logger.info("tenant time {} trigger time {} {}",
|
||||
new Object[] { tenantDateNow, nextTriggerDate, JobName.UPDATE_SMS_OUTBOUND_WITH_CAMPAIGN_MESSAGE.name() });
|
||||
if (nextTriggerDate.isBefore(tenantDateNow)) {
|
||||
insertDirectCampaignIntoSmsOutboundTable(smsCampaign);
|
||||
this.updateTriggerDates(smsCampaign.getId());
|
||||
|
||||
+2
-2
@@ -102,7 +102,7 @@ public class CodeValueWritePlatformServiceJpaRepositoryImpl implements CodeValue
|
||||
+ "' already exists", "name", name);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.code.value.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
@@ -161,7 +161,7 @@ public class CodeValueWritePlatformServiceJpaRepositoryImpl implements CodeValue
|
||||
.withSubEntityId(codeValueId)//
|
||||
.build();
|
||||
} catch (final DataIntegrityViolationException dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
final Throwable realCause = dve.getMostSpecificCause();
|
||||
if (realCause.getMessage().contains("code_value")) { throw new PlatformDataIntegrityException("error.msg.codeValue.in.use",
|
||||
"This code value is in use", codeValueId); }
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatf
|
||||
"name", name);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.cund.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ public class GlobalConfigurationWritePlatformServiceJpaRepositoryImpl implements
|
||||
private void handleDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
||||
|
||||
final Throwable realCause = dve.getMostSpecificCause();
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.globalConfiguration.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public class DataSourceConfiguration {
|
||||
public DataSource tenantDataSourceJndi() {
|
||||
PoolConfiguration p = getProperties();
|
||||
org.apache.tomcat.jdbc.pool.DataSource ds = new org.apache.tomcat.jdbc.pool.DataSource(p);
|
||||
logger.info("Created new DataSource; url=" + p.getUrl());
|
||||
logger.info("Created new DataSource; url={}", p.getUrl());
|
||||
return ds;
|
||||
}
|
||||
|
||||
|
||||
+3
-5
@@ -72,7 +72,7 @@ public class TenantDataSourcePortFixService {
|
||||
|
||||
public void fixUpTenantsSchemaServerPort() {
|
||||
if (!enabled) {
|
||||
logger.info("No schema_server_port UPDATE made to tenant_server_connections table of the fineract_tenants schema, because " + ENABLED + " = false");
|
||||
logger.info("No schema_server_port UPDATE made to tenant_server_connections table of the fineract_tenants schema, because {} = false", ENABLED);
|
||||
return;
|
||||
}
|
||||
if (dsp == null) {
|
||||
@@ -86,10 +86,8 @@ public class TenantDataSourcePortFixService {
|
||||
if ( r == 0 )
|
||||
logger.warn("UPDATE tenant_server_connections SET ... did not update ANY rows - something is probably wrong");
|
||||
else
|
||||
logger.info("Upated "
|
||||
+ r
|
||||
+ " rows in the tenant_server_connections table of the fineract_tenants schema to the real current host: "
|
||||
+ dsp.getHost() + ", port: " + dsp.getPort());
|
||||
logger.info("Upated {} rows in the tenant_server_connections table of the fineract_tenants schema to the real current host: {}, port: {}",
|
||||
new Object[] { r, dsp.getHost(), dsp.getPort() });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -105,7 +105,7 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
||||
final String foreignKeyColumnName = EntityTables.getForeignKeyColumnNameOnDatatable(entity);
|
||||
final boolean columnExist = datatableData.hasColumn(foreignKeyColumnName);
|
||||
|
||||
logger.info(datatableData.getRegisteredTableName() + "has column " + foreignKeyColumnName + " ? " + columnExist);
|
||||
logger.info("{} has column {} ? {}", new Object[] { datatableData.getRegisteredTableName(), foreignKeyColumnName, columnExist });
|
||||
|
||||
if (!columnExist) { throw new EntityDatatableCheckNotSupportedException(datatableData.getRegisteredTableName(), entity); }
|
||||
|
||||
@@ -163,7 +163,7 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
||||
final String datatableName = t.getDatatableName();
|
||||
final Long countEntries = readWriteNonCoreDataService.countDatatableEntries(datatableName, entityId, foreignKeyColumn);
|
||||
|
||||
logger.info("The are " + countEntries + " entries in the table " + datatableName);
|
||||
logger.info("The are {} entries in the table {}", countEntries, datatableName);
|
||||
if (countEntries.intValue() == 0) {
|
||||
reqDatatables.add(datatableName);
|
||||
}
|
||||
@@ -189,7 +189,7 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
||||
final String datatableName = t.getDatatableName();
|
||||
final Long countEntries = readWriteNonCoreDataService.countDatatableEntries(datatableName, entityId, foreignKeyColumn);
|
||||
|
||||
logger.info("The are " + countEntries + " entries in the table " + datatableName);
|
||||
logger.info("The are {} entries in the table {}", countEntries, datatableName);
|
||||
if (countEntries.intValue() == 0) {
|
||||
reqDatatables.add(datatableName);
|
||||
}
|
||||
@@ -289,7 +289,7 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
||||
throw new EntityDatatableCheckAlreadyExistsException(entity, status, datatableName, productId);
|
||||
}
|
||||
|
||||
logger.error(dae.getMessage(), dae);
|
||||
logger.error("Error occured.", dae);
|
||||
throw new PlatformDataIntegrityException("error.msg.report.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+11
-11
@@ -126,7 +126,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
final StringBuffer writer = new StringBuffer();
|
||||
|
||||
final List<ResultsetColumnHeaderData> columnHeaders = result.getColumnHeaders();
|
||||
logger.info("NO. of Columns: " + columnHeaders.size());
|
||||
logger.info("NO. of Columns: {}", columnHeaders.size());
|
||||
final Integer chSize = columnHeaders.size();
|
||||
for (int i = 0; i < chSize; i++) {
|
||||
writer.append('"' + columnHeaders.get(i).getColumnName() + '"');
|
||||
@@ -144,7 +144,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
String currVal;
|
||||
final String doubleQuote = "\"";
|
||||
final String twoDoubleQuotes = doubleQuote + doubleQuote;
|
||||
logger.info("NO. of Rows: " + data.size());
|
||||
logger.info("NO. of Rows: {}", data.size());
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
row = data.get(i).getRow();
|
||||
rSize = row.size();
|
||||
@@ -176,14 +176,14 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
final Map<String, String> queryParams, final boolean isSelfServiceUserReport) {
|
||||
|
||||
final long startTime = System.currentTimeMillis();
|
||||
logger.info("STARTING REPORT: " + name + " Type: " + type);
|
||||
logger.info("STARTING REPORT: {} Type: {}", name, type);
|
||||
|
||||
final String sql = getSQLtoRun(name, type, queryParams, isSelfServiceUserReport);
|
||||
|
||||
final GenericResultsetData result = this.genericDataService.fillGenericResultSet(sql);
|
||||
|
||||
final long elapsed = System.currentTimeMillis() - startTime;
|
||||
logger.info("FINISHING Report/Request Name: " + name + " - " + type + " Elapsed Time: " + elapsed);
|
||||
logger.info("FINISHING Report/Request Name: {} - {} Elapsed Time: {}", new Object[] { name, type, elapsed });
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
final Set<String> keys = queryParams.keySet();
|
||||
for (final String key : keys) {
|
||||
final String pValue = queryParams.get(key);
|
||||
// logger.info("(" + key + " : " + pValue + ")");
|
||||
// logger.info("({} : {})", key, pValue);
|
||||
sql = this.genericDataService.replace(sql, key, pValue);
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
final List<ResultsetRowData> data = result.getData();
|
||||
List<String> row;
|
||||
|
||||
logger.info("NO. of Columns: " + columnHeaders.size());
|
||||
logger.info("NO. of Columns: {}", columnHeaders.size());
|
||||
final Integer chSize = columnHeaders.size();
|
||||
|
||||
final Document document = new Document(PageSize.B0.rotate());
|
||||
@@ -284,7 +284,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
Integer rSize;
|
||||
String currColType;
|
||||
String currVal;
|
||||
logger.info("NO. of Rows: " + data.size());
|
||||
logger.info("NO. of Rows: {}", data.size());
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
row = data.get(i).getRow();
|
||||
rSize = row.size();
|
||||
@@ -307,7 +307,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
document.close();
|
||||
return genaratePdf;
|
||||
} catch (final Exception e) {
|
||||
logger.error("error.msg.reporting.error:" + e.getMessage());
|
||||
logger.error("error.msg.reporting.error:", e);
|
||||
throw new PlatformDataIntegrityException("error.msg.exception.error", e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -506,14 +506,14 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
@Override
|
||||
public GenericResultsetData retrieveGenericResultSetForSmsEmailCampaign(String name, String type, Map<String, String> queryParams) {
|
||||
final long startTime = System.currentTimeMillis();
|
||||
logger.info("STARTING REPORT: " + name + " Type: " + type);
|
||||
logger.info("STARTING REPORT: {} Type: {}", name, type);
|
||||
|
||||
final String sql = sqlToRunForSmsEmailCampaign(name, type, queryParams);
|
||||
|
||||
final GenericResultsetData result = this.genericDataService.fillGenericResultSet(sql);
|
||||
|
||||
final long elapsed = System.currentTimeMillis() - startTime;
|
||||
logger.info("FINISHING Report/Request Name: " + name + " - " + type + " Elapsed Time: " + elapsed);
|
||||
logger.info("FINISHING Report/Request Name: {} - {} Elapsed Time: {}", new Object[] { name, type, elapsed });
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -553,7 +553,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
|
||||
final String reportPath = FileSystemContentRepository.FINERACT_BASE_DIR + File.separator + "pentahoReports" + File.separator
|
||||
+ reportName + ".prpt";
|
||||
logger.info("Report path: " + reportPath);
|
||||
logger.info("Report path: {}", reportPath);
|
||||
|
||||
// load report definition
|
||||
final ResourceManager manager = new ResourceManager();
|
||||
|
||||
+6
-6
@@ -206,7 +206,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@@ -749,7 +749,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
||||
try {
|
||||
codeId = this.jdbcTemplate.queryForObject(checkColumnCodeMapping.toString(), Integer.class);
|
||||
} catch (final EmptyResultDataAccessException e) {
|
||||
logger.info(e.getMessage());
|
||||
logger.info("Error occured.", e);
|
||||
}
|
||||
return ObjectUtils.defaultIfNull(codeId, 0);
|
||||
}
|
||||
@@ -1133,7 +1133,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
||||
pkValue = datatableId;
|
||||
}
|
||||
final String sql = getUpdateSql(grs.getColumnHeaders(), dataTableName, pkName, pkValue, changes);
|
||||
logger.info("Update sql: " + sql);
|
||||
logger.info("Update sql: {}", sql);
|
||||
if (StringUtils.isNotBlank(sql)) {
|
||||
this.jdbcTemplate.update(sql);
|
||||
changes.put("locale", dataParams.get("locale"));
|
||||
@@ -1240,7 +1240,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
||||
private CommandProcessingResult checkMainResourceExistsWithinScope(final String appTable, final Long appTableId) {
|
||||
|
||||
final String sql = dataScopedSQL(appTable, appTableId);
|
||||
logger.info("data scoped sql: " + sql);
|
||||
logger.info("data scoped sql: {}", sql);
|
||||
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql);
|
||||
|
||||
if (!rs.next()) { throw new DatatableNotFoundException(appTable, appTableId); }
|
||||
@@ -1432,7 +1432,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
||||
addSql = "insert into `" + datatable + "` (`" + fkName + "` " + insertColumns + ")" + " select " + appTableId + " as id"
|
||||
+ selectColumns;
|
||||
|
||||
logger.info(addSql);
|
||||
logger.info("{}", addSql);
|
||||
|
||||
return addSql;
|
||||
}
|
||||
@@ -1483,7 +1483,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
||||
+ " as id" + selectColumns + " , ( SELECT SUM( code_score ) FROM m_code_value WHERE m_code_value.id IN (" + scoresId
|
||||
+ " ) ) as score";
|
||||
|
||||
logger.info(vaddSql);
|
||||
logger.info("{}", vaddSql);
|
||||
|
||||
return vaddSql;
|
||||
}
|
||||
|
||||
+1
-1
@@ -185,7 +185,7 @@ public class ReportWritePlatformServiceImpl implements ReportWritePlatformServic
|
||||
"name", name);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.report.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ public class FileSystemContentRepository implements ContentRepository {
|
||||
final boolean fileDeleted = deleteFile(location);
|
||||
if (!fileDeleted) {
|
||||
// no need to throw an Error, simply log a warning
|
||||
logger.warn("Unable to delete image associated with clients with Id " + resourceId);
|
||||
logger.warn("Unable to delete image associated with clients with Id {}", resourceId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -107,10 +107,10 @@ public class S3ContentRepository implements ContentRepository {
|
||||
deleteObjectFromS3(location);
|
||||
} catch (final AmazonServiceException ase) {
|
||||
deleteObjectAmazonServiceExceptionMessage(ase);
|
||||
logger.warn("Unable to delete image associated with clients with Id " + resourceId);
|
||||
logger.warn("Unable to delete image associated with clients with Id {}", resourceId);
|
||||
} catch (final AmazonClientException ace) {
|
||||
deleteObjectAmazonClientExceptionMessage(ace);
|
||||
logger.warn("Unable to delete image associated with clients with Id " + resourceId);
|
||||
logger.warn("Unable to delete image associated with clients with Id {}", resourceId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class S3ContentRepository implements ContentRepository {
|
||||
final S3Object s3object = this.s3Client.getObject(new GetObjectRequest(this.s3BucketName, documentData.fileLocation()));
|
||||
fileData = new FileData(s3object.getObjectContent(), fileName, documentData.contentType());
|
||||
} catch (final AmazonClientException ace) {
|
||||
logger.error(ace.getMessage());
|
||||
logger.error("Error occured.", ace);
|
||||
throw new DocumentNotFoundException(documentData.getParentEntityType(), documentData.getParentEntityId(), documentData.getId());
|
||||
}
|
||||
return fileData;
|
||||
@@ -140,21 +140,21 @@ public class S3ContentRepository implements ContentRepository {
|
||||
final S3Object s3object = this.s3Client.getObject(new GetObjectRequest(this.s3BucketName, imageData.location()));
|
||||
imageData.updateContent(s3object.getObjectContent());
|
||||
}catch(AmazonS3Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
logger.error("Error occured.", e);
|
||||
}
|
||||
return imageData;
|
||||
}
|
||||
|
||||
private void deleteObjectAmazonClientExceptionMessage(final AmazonClientException ace) {
|
||||
final String message = "Caught an AmazonClientException." + "Error Message: " + ace.getMessage();
|
||||
logger.error(message);
|
||||
logger.error("{}", message);
|
||||
}
|
||||
|
||||
private void deleteObjectAmazonServiceExceptionMessage(final AmazonServiceException ase) {
|
||||
final String message = "Caught an AmazonServiceException." + "Error Message: " + ase.getMessage() + "HTTP Status Code: "
|
||||
+ ase.getStatusCode() + "AWS Error Code: " + ase.getErrorCode() + "Error Type: " + ase.getErrorType()
|
||||
+ "Request ID: " + ase.getRequestId();
|
||||
logger.error(message);
|
||||
logger.error("{}", message);
|
||||
}
|
||||
|
||||
private String generateFileParentDirectory(final String entityType, final Long entityId) {
|
||||
@@ -173,7 +173,7 @@ public class S3ContentRepository implements ContentRepository {
|
||||
private void uploadDocument(final String filename, final InputStream inputStream, final String s3UploadLocation)
|
||||
throws ContentManagementException {
|
||||
try {
|
||||
logger.info("Uploading a new object to S3 from a file to " + s3UploadLocation);
|
||||
logger.info("Uploading a new object to S3 from a file to {}", s3UploadLocation);
|
||||
this.s3Client.putObject(new PutObjectRequest(this.s3BucketName, s3UploadLocation, inputStream, new ObjectMetadata()));
|
||||
} catch (final AmazonClientException ace) {
|
||||
final String message = ace.getMessage();
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ public class FileData {
|
||||
if (this.inputStream == null) { return new FileInputStream(this.file); }
|
||||
return this.inputStream;
|
||||
} catch (final FileNotFoundException e) {
|
||||
logger.error(e.toString());
|
||||
logger.error("Error occured.", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -67,7 +67,7 @@ public class ImageData {
|
||||
return IOUtils.toByteArray(fileInputStream);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage());
|
||||
logger.error("Error occured.", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public class ImageData {
|
||||
out = resizeImage(this.inputStream, maxWidth != null ? maxWidth : Integer.MAX_VALUE,
|
||||
maxHeight != null ? maxHeight : Integer.MAX_VALUE);
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage());
|
||||
logger.error("Error occured.", e);
|
||||
}
|
||||
} else if (this.storageType.equals(StorageType.FILE_SYSTEM.getValue()) && this.file != null) {
|
||||
FileInputStream fis = null;
|
||||
@@ -120,13 +120,13 @@ public class ImageData {
|
||||
fis = new FileInputStream(this.file);
|
||||
out = resizeImage(fis, maxWidth != null ? maxWidth : Integer.MAX_VALUE, maxHeight != null ? maxHeight : Integer.MAX_VALUE);
|
||||
} catch (IOException ex) {
|
||||
logger.error(ex.getMessage());
|
||||
logger.error("Error occured.", ex);
|
||||
} finally {
|
||||
if (fis != null) {
|
||||
try {
|
||||
fis.close();
|
||||
} catch (IOException ex) {
|
||||
logger.error(ex.getMessage());
|
||||
logger.error("Error occured.", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,7 +181,7 @@ public class ImageData {
|
||||
try {
|
||||
available = this.inputStream.available();
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage());
|
||||
logger.error("Error occured.", e);
|
||||
}
|
||||
} else if (this.storageType.equals(StorageType.FILE_SYSTEM.getValue()) && this.file != null) {
|
||||
FileInputStream fileInputStream = null;
|
||||
@@ -190,9 +190,9 @@ public class ImageData {
|
||||
available = fileInputStream.available();
|
||||
fileInputStream.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
logger.error(e.getMessage());
|
||||
logger.error("Error occured.", e);
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage());
|
||||
logger.error("Error occured.", e);
|
||||
} finally {
|
||||
if (fileInputStream != null) {
|
||||
try {
|
||||
|
||||
+3
-3
@@ -80,7 +80,7 @@ public class DocumentWritePlatformServiceJpaRepositoryImpl implements DocumentWr
|
||||
|
||||
return document.getId();
|
||||
} catch (final DataIntegrityViolationException dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.document.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
@@ -136,11 +136,11 @@ public class DocumentWritePlatformServiceJpaRepositoryImpl implements DocumentWr
|
||||
|
||||
return new CommandProcessingResult(documentForUpdate.getId());
|
||||
} catch (final DataIntegrityViolationException dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.document.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
} catch (final ContentManagementException cme) {
|
||||
logger.error(cme.getMessage(), cme);
|
||||
logger.error("Error occured.", cme);
|
||||
throw new ContentManagementException(documentCommand.getName(), cme.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
+3
-4
@@ -23,7 +23,6 @@ import java.sql.SQLException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
|
||||
import org.apache.fineract.infrastructure.dataqueries.service.GenericDataServiceImpl;
|
||||
import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityAccessData;
|
||||
import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityRelationData;
|
||||
import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityToEntityMappingData;
|
||||
@@ -47,7 +46,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
private final static Logger logger = LoggerFactory.getLogger(GenericDataServiceImpl.class);
|
||||
private final static Logger logger = LoggerFactory.getLogger(FineractEntityAccessReadServiceImpl.class);
|
||||
private final FineractEntityRelationRepositoryWrapper fineractEntityRelationRepository;
|
||||
|
||||
@Autowired
|
||||
@@ -107,7 +106,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
||||
if (accessListCSVStrBuf != null) {
|
||||
returnIdListStr = accessListCSVStrBuf.toString();
|
||||
}
|
||||
logger.debug("List of IDs applicable:" + returnIdListStr);
|
||||
logger.debug("List of IDs applicable: {}", returnIdListStr);
|
||||
return returnIdListStr;
|
||||
}
|
||||
|
||||
@@ -144,7 +143,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
||||
str.append("from m_entity_to_entity_mapping eem ");
|
||||
str.append("where eem.rel_id = ? ");
|
||||
str.append("and eem.from_id = ? ");
|
||||
logger.debug(str.toString());
|
||||
logger.debug("{}", str);
|
||||
return str.toString();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -178,7 +178,7 @@ public class FineractEntityAccessWriteServiceImpl implements FineractEntityAcces
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+2
-3
@@ -95,13 +95,12 @@ public class ProcessorHelper {
|
||||
return new Callback() {
|
||||
@Override
|
||||
public void success(final Object o, final Response response) {
|
||||
logger.info("URL : " + url + "\tStatus : "
|
||||
+ response.getStatus());
|
||||
logger.info("URL: {}\tStatus: {}", url, response.getStatus());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failure(final RetrofitError retrofitError) {
|
||||
logger.info(retrofitError.getMessage());
|
||||
logger.info("Error occured.", retrofitError);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
+5
-5
@@ -164,7 +164,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
||||
|
||||
} catch (final Exception e) {
|
||||
final String msg = "Job execution failed for job with id:" + scheduledJobDetail.getId();
|
||||
logger.error(msg, e);
|
||||
logger.error("{}", msg, e);
|
||||
throw new PlatformInternalServerException("error.msg.sheduler.job.execution.failed", msg, scheduledJobDetail.getId());
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
||||
}
|
||||
}
|
||||
} catch (final SchedulerException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
logger.error("Error occured.", e);
|
||||
}
|
||||
}
|
||||
jobDetail.updateTriggerMisfired(false);
|
||||
@@ -281,7 +281,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
||||
scheduledJobDetails.updateNextRunTime(null);
|
||||
final String stackTrace = getStackTraceAsString(throwable);
|
||||
scheduledJobDetails.updateErrorLog(stackTrace);
|
||||
logger.error("Could not schedule job: " + scheduledJobDetails.getJobName(), throwable);
|
||||
logger.error("Could not schedule job: {}", scheduledJobDetails.getJobName(), throwable);
|
||||
}
|
||||
scheduledJobDetails.updateCurrentlyRunningStatus(false);
|
||||
}
|
||||
@@ -292,7 +292,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
||||
try {
|
||||
scheduler.shutdown();
|
||||
} catch (final SchedulerException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
logger.error("Error occured.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
||||
try {
|
||||
scheduler.shutdown();
|
||||
} catch (final SchedulerException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
logger.error("Error occured.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ public class SchedulerTriggerListener implements TriggerListener {
|
||||
proceedJob = this.schedularService.processJobDetailForExecution(jobKey, triggerType);
|
||||
numberOfRetries = maxNumberOfRetries + 1;
|
||||
} catch (Exception exception) { //Adding generic exception as it depends on JPA provider
|
||||
logger.debug("Not able to acquire the lock to update job running status for JobKey: " + jobKey);
|
||||
logger.debug("Not able to acquire the lock to update job running status for JobKey: {}", jobKey);
|
||||
try {
|
||||
Random random = new Random();
|
||||
int randomNum = random.nextInt(maxIntervalBetweenRetries + 1);
|
||||
|
||||
+2
-2
@@ -70,12 +70,12 @@ public class ReportingProcessServiceProvider implements ApplicationContextAware
|
||||
final String[] reportServiceBeans = this.applicationContext.getBeanNamesForAnnotation(ReportService.class);
|
||||
if (ArrayUtils.isNotEmpty(reportServiceBeans)) {
|
||||
for (final String reportName : reportServiceBeans) {
|
||||
LOGGER.info("Register report service '" + reportName + "' ...");
|
||||
LOGGER.info("Register report service '{}' ...", reportName);
|
||||
final ReportService service = this.applicationContext.findAnnotationOnBean(reportName, ReportService.class);
|
||||
try {
|
||||
this.reportingProcessServices.put(service.type(), reportName);
|
||||
} catch (final Throwable th) {
|
||||
LOGGER.error("Unable to register reporting service '" + reportName + "'!", th);
|
||||
LOGGER.error("Unable to register reporting service '{}'!", reportName, th);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -399,7 +399,7 @@ public class ReportMailingJobWritePlatformServiceImpl implements ReportMailingJo
|
||||
ReportMailingJobConstants.NAME_PARAM_NAME, name);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
|
||||
throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ public class TenantAwareBasicAuthenticationFilter extends BasicAuthenticationFil
|
||||
} finally {
|
||||
task.stop();
|
||||
final PlatformRequestLog log = PlatformRequestLog.from(task, request);
|
||||
logger.debug(this.toApiJsonSerializer.serialize(log));
|
||||
logger.debug("{}", this.toApiJsonSerializer.serialize(log));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ public class TenantAwareTenantIdentifierFilter extends GenericFilterBean {
|
||||
} finally {
|
||||
task.stop();
|
||||
final PlatformRequestLog log = PlatformRequestLog.from(task, request);
|
||||
logger.info(this.toApiJsonSerializer.serialize(log));
|
||||
logger.info("{}", this.toApiJsonSerializer.serialize(log));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -63,11 +63,11 @@ public class CustomAuthenticationFailureHandler implements AuthenticationFailure
|
||||
saveException(request, exception);
|
||||
|
||||
if (this.forwardToDestination) {
|
||||
this.logger.debug("Forwarding to " + this.defaultFailureUrl);
|
||||
this.logger.debug("Forwarding to {}", this.defaultFailureUrl);
|
||||
|
||||
request.getRequestDispatcher(this.defaultFailureUrl).forward(request, response);
|
||||
} else {
|
||||
this.logger.debug("Redirecting to " + this.defaultFailureUrl);
|
||||
this.logger.debug("Redirecting to {}", this.defaultFailureUrl);
|
||||
|
||||
final String oauthToken = request.getParameter("oauth_token");
|
||||
request.setAttribute("oauth_token", oauthToken);
|
||||
|
||||
+7
-8
@@ -181,7 +181,7 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob
|
||||
if (responseOne != null) {
|
||||
// String smsResponse = responseOne.getBody();
|
||||
if (!responseOne.getStatusCode().equals(HttpStatus.ACCEPTED)) {
|
||||
logger.debug(responseOne.getStatusCode().name());
|
||||
logger.debug("{}", responseOne.getStatusCode().name());
|
||||
throw new ConnectionFailureException(SmsCampaignConstants.SMS);
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
logger.error("Error occured.", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,11 +242,11 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob
|
||||
}
|
||||
this.smsMessageRepository.saveAll(smsMessages);
|
||||
request.append(SmsMessageApiQueueResourceData.toJsonString(apiQueueResourceDatas));
|
||||
logger.info("Sending triggered SMS to specific provider with request - " + request.toString());
|
||||
logger.info("Sending triggered SMS to specific provider with request - {}", request);
|
||||
this.triggeredExecutorService.execute(new SmsTask(ThreadLocalContextUtil.getTenant(),
|
||||
apiQueueResourceDatas));
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
logger.error("Error occured.", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,20 +320,19 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob
|
||||
this.smsMessageRepository.save(smsMessage);
|
||||
|
||||
if (statusChanged) {
|
||||
logger.info("Status of SMS message id: " + smsMessage.getId() + " successfully changed to " + statusType);
|
||||
logger.info("Status of SMS message id: {} successfully changed to {}", smsMessage.getId(), statusType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (smsMessageDeliveryReportDatas.size() > 0) {
|
||||
logger.info(smsMessageDeliveryReportDatas.size() + " "
|
||||
+ "delivery report(s) successfully received from the intermediate gateway - sms");
|
||||
logger.info("{} delivery report(s) successfully received from the intermediate gateway - sms", smsMessageDeliveryReportDatas.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
logger.error("Error occured.", e);
|
||||
}
|
||||
page ++;
|
||||
totalRecords = smsMessageInternalIds.getTotalFilteredRecords();
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ public class SmsWritePlatformServiceJpaRepositoryImpl implements SmsWritePlatfor
|
||||
if (realCause.getMessage().contains("mobile_no")) { throw new PlatformDataIntegrityException("error.msg.sms.no.mobile.no.exists",
|
||||
"The group, client or staff provided has no mobile no.", "id"); }
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.sms.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class WriteLikelihoodServiceImpl implements WriteLikelihoodService {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(PovertyLineService.class);
|
||||
private final static Logger logger = LoggerFactory.getLogger(WriteLikelihoodServiceImpl.class);
|
||||
private final PlatformSecurityContext context;
|
||||
private final LikelihoodDataValidator likelihoodDataValidator;
|
||||
private final LikelihoodRepository repository;
|
||||
@@ -95,7 +95,7 @@ public class WriteLikelihoodServiceImpl implements WriteLikelihoodService {
|
||||
private void handleDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
||||
|
||||
final Throwable realCause = dve.getMostSpecificCause();
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.likelihood.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-2
@@ -21,7 +21,6 @@ package org.apache.fineract.notification.config;
|
||||
import javax.jms.ExceptionListener;
|
||||
import javax.jms.JMSException;
|
||||
import org.apache.activemq.ActiveMQConnectionFactory;
|
||||
import org.apache.fineract.infrastructure.core.boot.db.TenantDataSourcePortFixService;
|
||||
import org.apache.fineract.notification.eventandlistener.NotificationEventListener;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -43,7 +42,7 @@ public class MessagingConfiguration {
|
||||
private NotificationEventListener notificationEventListener;
|
||||
|
||||
@Bean
|
||||
public Logger loggerBean() { return LoggerFactory.getLogger(TenantDataSourcePortFixService.class); }
|
||||
public Logger loggerBean() { return LoggerFactory.getLogger(MessagingConfiguration.class); }
|
||||
|
||||
private static final String DEFAULT_BROKER_URL = "tcp://localhost:61616";
|
||||
|
||||
|
||||
+1
-1
@@ -183,7 +183,7 @@ public class HolidayWritePlatformServiceJpaRepositoryImpl implements HolidayWrit
|
||||
"name", name);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.office.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
+1
-1
@@ -239,7 +239,7 @@ public class OfficeWritePlatformServiceJpaRepositoryImpl implements OfficeWriteP
|
||||
"name", name);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.office.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
+2
-3
@@ -31,7 +31,6 @@ import org.apache.fineract.organisation.provisioning.domain.ProvisioningCategory
|
||||
import org.apache.fineract.organisation.provisioning.exception.ProvisioningCategoryCannotBeDeletedException;
|
||||
import org.apache.fineract.organisation.provisioning.exception.ProvisioningCategoryNotFoundException;
|
||||
import org.apache.fineract.organisation.provisioning.serialization.ProvisioningCategoryDefinitionJsonDeserializer;
|
||||
import org.apache.fineract.portfolio.charge.service.ChargeWritePlatformServiceJpaRepositoryImpl;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -42,7 +41,7 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl implements ProvisioningCategoryWritePlatformService {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(ChargeWritePlatformServiceJpaRepositoryImpl.class);
|
||||
private final static Logger logger = LoggerFactory.getLogger(ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.class);
|
||||
|
||||
private final ProvisioningCategoryRepository provisioningCategoryRepository;
|
||||
|
||||
@@ -126,7 +125,7 @@ public class ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl implement
|
||||
throw new PlatformDataIntegrityException("error.msg.provisioning.duplicate.categoryname", "Provisioning Cateory with name `"
|
||||
+ name + "` already exists", "category name", name);
|
||||
}
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -169,7 +169,7 @@ public class ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl implement
|
||||
"error.msg.provisioning.product.id(s).already.associated.existing.criteria",
|
||||
"The selected products already associated with another Provisioning Criteria");
|
||||
}
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.provisioning.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ public class StaffWritePlatformServiceJpaRepositoryImpl implements StaffWritePla
|
||||
+ displayName + "' already exists", "displayName", displayName);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.staff.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -211,7 +211,7 @@ public class TellerWritePlatformServiceJpaImpl implements TellerWritePlatformSer
|
||||
"name", name);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.teller.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
+1
-1
@@ -144,7 +144,7 @@ public class StandingInstructionWritePlatformServiceImpl implements StandingInst
|
||||
throw new PlatformDataIntegrityException("error.msg.standinginstruction.duplicate.name", "Standinginstruction with name `"
|
||||
+ name + "` already exists", "name", name);
|
||||
}
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.client.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
+1
-1
@@ -233,7 +233,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
||||
"name", name);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -438,7 +438,7 @@ public class ClientChargeWritePlatformServiceJpaRepositoryImpl implements Client
|
||||
"Client charge with id `" + clientChargeId + "` cannot be deleted as transactions have been made on the same",
|
||||
"clientChargeId", clientChargeId); }
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.client.charges.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
+1
-1
@@ -200,6 +200,6 @@ public class ClientIdentifierWritePlatformServiceJpaRepositoryImpl implements Cl
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -182,7 +182,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
||||
.build();
|
||||
} catch (DataIntegrityViolationException dve) {
|
||||
Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()) ;
|
||||
logger.error(throwable.getMessage());
|
||||
logger.error("Error occured.", throwable);
|
||||
throw new PlatformDataIntegrityException("error.msg.client.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
@@ -615,7 +615,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ public class CollateralWritePlatformServiceJpaRepositoryImpl implements Collater
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ public class FloatingRateWritePlatformServiceImpl implements
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(
|
||||
Exception dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ public class FundWritePlatformServiceJpaRepositoryImpl implements FundWritePlatf
|
||||
"name", name);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.fund.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ public class GroupRolesWritePlatformServiceJpaRepositoryImpl implements GroupRol
|
||||
GroupingTypesApiConstants.clientIdParamName, roleId, clientId, command.getGroupId());
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
+2
-2
@@ -603,7 +603,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
||||
.build();
|
||||
} catch (DataIntegrityViolationException dve) {
|
||||
Throwable throwable = ExceptionUtils.getRootCause(dve.getCause());
|
||||
logger.error(throwable.getMessage());
|
||||
logger.error("Error occured.", throwable);
|
||||
throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
@@ -798,7 +798,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
||||
name);
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
+1
-1
@@ -334,7 +334,7 @@ public class GuarantorWritePlatformServiceJpaRepositoryIImpl implements Guaranto
|
||||
|
||||
private void handleGuarantorDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
||||
final Throwable realCause = dve.getMostSpecificCause();
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.guarantor.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource Guarantor: " + realCause.getMessage());
|
||||
}
|
||||
|
||||
+1
-1
@@ -586,7 +586,7 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
**/
|
||||
private void handleDataIntegrityViolation(final DataIntegrityViolationException dve) {
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
|
||||
throw new PlatformDataIntegrityException("error.msg.loan.reschedule.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
|
||||
+1
-1
@@ -1079,7 +1079,7 @@ public void checkForProductMixRestrictions(final Loan loan) {
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
||||
+2
-3
@@ -41,7 +41,6 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleIns
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanSummary;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.data.LoanSchedulePeriodData;
|
||||
import org.apache.fineract.scheduledjobs.service.ScheduledJobRunnerServiceImpl;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.format.DateTimeFormat;
|
||||
import org.joda.time.format.DateTimeFormatter;
|
||||
@@ -57,7 +56,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Service
|
||||
public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, BusinessEventListner {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(ScheduledJobRunnerServiceImpl.class);
|
||||
private final static Logger logger = LoggerFactory.getLogger(LoanArrearsAgingServiceImpl.class);
|
||||
private final BusinessEventNotifierService businessEventNotifierService;
|
||||
private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
@@ -126,7 +125,7 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, Bus
|
||||
result += i;
|
||||
}
|
||||
|
||||
logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by update: " + result);
|
||||
logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -206,7 +206,7 @@ public class LoanSchedularServiceImpl implements LoanSchedularService {
|
||||
// gets the loanIds data set iteratively and call addAccuruals for that paginated dataset
|
||||
do {
|
||||
int totalFilteredRecords = loanIds.size();
|
||||
logger.info("Starting accrual - total filtered records - " + totalFilteredRecords);
|
||||
logger.info("Starting accrual - total filtered records - {}", totalFilteredRecords);
|
||||
recalculateInterest(loanIds, threadPoolSize, batchSize, executorService);
|
||||
maxLoanIdInList+= pageSize+1;
|
||||
loanIds = Collections.synchronizedList(this.loanReadPlatformService
|
||||
|
||||
+3
-3
@@ -58,7 +58,7 @@ public class RecalculateInterestPoster implements Callable<Void> {
|
||||
if (!loanIds.isEmpty()) {
|
||||
int errors = 0;
|
||||
for (Long loanId : loanIds) {
|
||||
logger.info("Loan ID " + loanId);
|
||||
logger.info("Loan ID {}", loanId);
|
||||
Integer numberOfRetries = 0;
|
||||
while (numberOfRetries <= maxNumberOfRetries) {
|
||||
try {
|
||||
@@ -66,7 +66,7 @@ public class RecalculateInterestPoster implements Callable<Void> {
|
||||
numberOfRetries = maxNumberOfRetries + 1;
|
||||
} catch (CannotAcquireLockException
|
||||
| ObjectOptimisticLockingFailureException exception) {
|
||||
logger.info("Recalulate interest job has been retried time(s)", numberOfRetries);
|
||||
logger.info("Recalulate interest job has been retried {} time(s)", numberOfRetries);
|
||||
// Fail if the transaction has been retired for maxNumberOfRetries
|
||||
if (numberOfRetries >= maxNumberOfRetries) {
|
||||
logger.error("Recalulate interest job has been retried for the max allowed attempts of {} and will be rolled back", numberOfRetries);
|
||||
@@ -91,7 +91,7 @@ public class RecalculateInterestPoster implements Callable<Void> {
|
||||
}
|
||||
i++;
|
||||
}
|
||||
logger.info("Loans count " + i);
|
||||
logger.info("Loans count {}", i);
|
||||
}
|
||||
if (errors > 0) { throw new JobExecutionException(errors); }
|
||||
}
|
||||
|
||||
+1
-1
@@ -194,7 +194,7 @@ public class ProductMixWritePlatformServiceJpaRepositoryImpl implements ProductM
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
}
|
||||
|
||||
private List<ProductMix> updateRestrictedIds(final Set<String> restrictedIds, final List<ProductMix> existedProductMixes) {
|
||||
|
||||
+1
-1
@@ -341,7 +341,7 @@ public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanPro
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
}
|
||||
|
||||
private Map<BusinessEventNotificationConstants.BUSINESS_ENTITY, Object> constructEntityMap(final BusinessEventNotificationConstants.BUSINESS_ENTITY entityEvent, Object entity) {
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ public class DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
||||
}
|
||||
|
||||
errorCodeBuilder.append(".unknown.data.integrity.issue");
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException(errorCodeBuilder.toString(), "Unknown data integrity issue with savings account.");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -207,6 +207,6 @@ public class FixedDepositProductWritePlatformServiceJpaRepositoryImpl implements
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
||||
this.logger.error(dae.getMessage(), dae);
|
||||
this.logger.error("Error occured.", dae);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -207,6 +207,6 @@ public class RecurringDepositProductWritePlatformServiceJpaRepositoryImpl implem
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
||||
this.logger.error(dae.getMessage(), dae);
|
||||
this.logger.error("Error occured.", dae);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
||||
}
|
||||
|
||||
errorCodeBuilder.append(".unknown.data.integrity.issue");
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException(errorCodeBuilder.toString(), "Unknown data integrity issue with savings account.");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ public class SavingsProductWritePlatformServiceJpaRepositoryImpl implements Savi
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
||||
this.logger.error(dae.getMessage(), dae);
|
||||
this.logger.error("Error occured.", dae);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
||||
+1
-1
@@ -200,7 +200,7 @@ public class SelfBeneficiariesTPTWritePlatformServiceImpl implements
|
||||
NAME_PARAM_NAME, name);
|
||||
}
|
||||
|
||||
this.logger.error(dae.getMessage(), dae);
|
||||
this.logger.error("Error occured.", dae);
|
||||
throw new PlatformDataIntegrityException(
|
||||
"error.msg.beneficiary.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
|
||||
+10
-11
@@ -173,7 +173,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
||||
|
||||
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
|
||||
|
||||
logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by update: " + result);
|
||||
logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@@ -208,7 +208,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
||||
|
||||
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
|
||||
|
||||
logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by update: " + result);
|
||||
logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -225,15 +225,14 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
||||
} catch (final PlatformApiDataValidationException e) {
|
||||
final List<ApiParameterError> errors = e.getErrors();
|
||||
for (final ApiParameterError error : errors) {
|
||||
logger.error("Apply annual fee failed for account:" + savingsAccountReference.getAccountNo() + " with message "
|
||||
+ error.getDeveloperMessage());
|
||||
logger.error("Apply annual fee failed for account: {} with message {}", savingsAccountReference.getAccountNo(), error);
|
||||
}
|
||||
} catch (final Exception ex) {
|
||||
// need to handle this scenario
|
||||
}
|
||||
}
|
||||
|
||||
logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Savings accounts affected by update: " + annualFeeData.size());
|
||||
logger.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), annualFeeData.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -288,7 +287,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
||||
|
||||
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
|
||||
|
||||
logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by update: " + result);
|
||||
logger.info("{} : Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -304,15 +303,14 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
||||
} catch (final PlatformApiDataValidationException e) {
|
||||
final List<ApiParameterError> errors = e.getErrors();
|
||||
for (final ApiParameterError error : errors) {
|
||||
logger.error("Update maturity details failed for account:" + depositAccount.accountNo() + " with message "
|
||||
+ error.getDeveloperMessage());
|
||||
logger.error("Update maturity details failed for account: {} with message {}", depositAccount.accountNo(), error.getDeveloperMessage());
|
||||
}
|
||||
} catch (final Exception ex) {
|
||||
// need to handle this scenario
|
||||
}
|
||||
}
|
||||
|
||||
logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Deposit accounts affected by update: " + depositAccounts.size());
|
||||
logger.info("{}: Deposit accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), depositAccounts.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -392,7 +390,8 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
||||
} catch (final PlatformApiDataValidationException e) {
|
||||
final List<ApiParameterError> errors = e.getErrors();
|
||||
for (final ApiParameterError error : errors) {
|
||||
logger.error("Post Dividends to savings failed due to ApiParameterError for Divident detail Id: {} and savings Id: {} with message: ", id, savingsId, error.getDeveloperMessage(), e);
|
||||
logger.error("Post Dividends to savings failed due to ApiParameterError for Divident detail Id: {} and savings Id: {} with message: {}",
|
||||
new Object[] { id, savingsId, error.getDeveloperMessage(), e });
|
||||
++numberOfErrors;
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
@@ -430,7 +429,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
||||
.append("group by je.account_id, je.office_id, je.transaction_date, Date(je.entry_date)");
|
||||
|
||||
final int result = jdbcTemplate.update(sqlBuilder.toString(), formattedDate);
|
||||
logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by update: " + result);
|
||||
logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||
}
|
||||
|
||||
// Updating closing balance
|
||||
|
||||
+1
-1
@@ -575,7 +575,7 @@ public class AppUser extends AbstractPersistableCustom<Long> implements Platform
|
||||
public void validateHasPermissionTo(final String function) {
|
||||
if (hasNotPermissionTo(function)) {
|
||||
final String authorizationMessage = "User has no authority to: " + function;
|
||||
logger.info("Unauthorized access: userId: " + getId() + " action: " + function + " allowed: " + getAuthorities());
|
||||
logger.info("Unauthorized access: userId: {} action: {} allowed: {}", new Object[] { getId(), function, getAuthorities() });
|
||||
throw new NoAuthorizationException(authorizationMessage);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -351,7 +351,7 @@ public class AppUserWritePlatformServiceJpaRepositoryImpl implements AppUserWrit
|
||||
throw new PlatformDataIntegrityException("error.msg.user.self.service.user.already.exist", "Self Service User Id is already created. Go to Admin->Users to edit or delete the self-service user.");
|
||||
}
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", "Unknown data integrity issue with resource.");
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class PasswordPreferencesWritePlatformServiceJpaRepositoryImpl implements
|
||||
.with(changes) //
|
||||
.build();
|
||||
} catch (final DataIntegrityViolationException dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.password.validation.policy.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
+4
-4
@@ -34,7 +34,7 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class PermissionReadPlatformServiceImpl implements PermissionReadPlatformService {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(PermissionReadPlatformService.class);
|
||||
private final static Logger logger = LoggerFactory.getLogger(PermissionReadPlatformServiceImpl.class);
|
||||
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
private final PlatformSecurityContext context;
|
||||
@@ -52,7 +52,7 @@ public class PermissionReadPlatformServiceImpl implements PermissionReadPlatform
|
||||
|
||||
final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper();
|
||||
final String sql = mapper.permissionSchema();
|
||||
logger.info("retrieveAllPermissions: " + sql);
|
||||
logger.info("retrieveAllPermissions: {}", sql);
|
||||
return this.jdbcTemplate.query(sql, mapper, new Object[] {});
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class PermissionReadPlatformServiceImpl implements PermissionReadPlatform
|
||||
|
||||
final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper();
|
||||
final String sql = mapper.makerCheckerablePermissionSchema();
|
||||
logger.info("retrieveAllMakerCheckerablePermissions: " + sql);
|
||||
logger.info("retrieveAllMakerCheckerablePermissions: {}", sql);
|
||||
|
||||
return this.jdbcTemplate.query(sql, mapper, new Object[] {});
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class PermissionReadPlatformServiceImpl implements PermissionReadPlatform
|
||||
|
||||
final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper();
|
||||
final String sql = mapper.rolePermissionSchema();
|
||||
logger.info("retrieveAllRolePermissions: " + sql);
|
||||
logger.info("retrieveAllRolePermissions: {}", sql);
|
||||
|
||||
return this.jdbcTemplate.query(sql, mapper, new Object[] { roleId });
|
||||
}
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||
logger.error(dve.getMessage(), dve);
|
||||
logger.error("Error occured.", dve);
|
||||
}
|
||||
|
||||
@Caching(evict = { @CacheEvict(value = "users", allEntries = true), @CacheEvict(value = "usersByUsername", allEntries = true) })
|
||||
|
||||
Reference in New Issue
Block a user