FINERACT-822 Enforce NonCanonicalType check

This commit is contained in:
percyashu
2020-06-29 22:28:17 +02:00
committed by Michael Vorburger ⛑️
parent e1e230d660
commit fde3d9f83e
5 changed files with 8 additions and 4 deletions
@@ -18,6 +18,7 @@
*/
package org.apache.fineract.batch.command;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.fineract.batch.command.internal.UnknownCommandStrategy;
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +37,7 @@ import org.springframework.stereotype.Component;
public class CommandStrategyProvider {
private final ApplicationContext applicationContext;
private final ConcurrentHashMap<CommandContext, String> commandStrategies = new ConcurrentHashMap<>();
private final Map<CommandContext, String> commandStrategies = new ConcurrentHashMap<>();
/**
* Constructs a CommandStrategyProvider with argument of ApplicationContext type. It also initialize
@@ -68,7 +69,7 @@ public class CommandStrategyProvider {
return (CommandStrategy) this.applicationContext.getBean(this.commandStrategies.get(commandContext));
}
for (ConcurrentHashMap.Entry<CommandContext, String> entry : this.commandStrategies.entrySet()) {
for (Map.Entry<CommandContext, String> entry : this.commandStrategies.entrySet()) {
if (commandContext.matcher(entry.getKey())) {
return (CommandStrategy) this.applicationContext.getBean(this.commandStrategies.get(entry.getKey()));
}
@@ -54,7 +54,7 @@ public class ColumnValidator {
connection = this.jdbcTemplate.getDataSource().getConnection();
DatabaseMetaData dbMetaData = connection.getMetaData();
ResultSet resultSet = null;
for (HashMap.Entry<String, Set<String>> entry : tableColumnMap.entrySet()) {
for (Map.Entry<String, Set<String>> entry : tableColumnMap.entrySet()) {
Set<String> columns = entry.getValue();
resultSet = dbMetaData.getColumns(null, null, entry.getKey(), null);
Set<String> tableColumns = getTableColumns(resultSet);