TSK-1252: Fixed new code smells of the last 30 days
This commit is contained in:
parent
7dcd42bd52
commit
df4fd17264
|
@ -13,7 +13,9 @@ import pro.taskana.spi.history.api.TaskanaHistory;
|
|||
import pro.taskana.spi.history.api.events.TaskanaHistoryEvent;
|
||||
import pro.taskana.spi.history.api.exceptions.TaskanaHistoryEventNotFoundException;
|
||||
|
||||
/** This is the implementation of TaskanaHistory. */
|
||||
/**
|
||||
* This is the implementation of TaskanaHistory.
|
||||
*/
|
||||
public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SimpleHistoryServiceImpl.class);
|
||||
|
@ -23,16 +25,14 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
|||
|
||||
@Override
|
||||
public void initialize(TaskanaEngineConfiguration taskanaEngineConfiguration) {
|
||||
try {
|
||||
this.taskanaHistoryEngine = getTaskanaEngine(taskanaEngineConfiguration);
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(
|
||||
"Simple history service implementation initialized with schemaName: {} ",
|
||||
taskanaEngineConfiguration.getSchemaName());
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error("There was an error creating Taskana history engine", e);
|
||||
|
||||
this.taskanaHistoryEngine = getTaskanaEngine(taskanaEngineConfiguration);
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(
|
||||
"Simple history service implementation initialized with schemaName: {} ",
|
||||
taskanaEngineConfiguration.getSchemaName());
|
||||
}
|
||||
|
||||
this.historyEventMapper =
|
||||
this.taskanaHistoryEngine.getSqlSession().getMapper(HistoryEventMapper.class);
|
||||
this.historyQueryMapper =
|
||||
|
@ -88,8 +88,7 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
|||
/*
|
||||
* ATTENTION: This method exists for testing purposes.
|
||||
*/
|
||||
TaskanaHistoryEngineImpl getTaskanaEngine(TaskanaEngineConfiguration taskanaEngineConfiguration)
|
||||
throws SQLException {
|
||||
TaskanaHistoryEngineImpl getTaskanaEngine(TaskanaEngineConfiguration taskanaEngineConfiguration) {
|
||||
return TaskanaHistoryEngineImpl.createTaskanaEngine(taskanaEngineConfiguration);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,9 +122,11 @@ public class DbSchemaCreator {
|
|||
}
|
||||
|
||||
private static String selectDbSchemaDetectionScript(String dbProductName) {
|
||||
return DB.isPostgreSql(dbProductName)
|
||||
? DB_SCHEMA_DETECTION_POSTGRES
|
||||
: DB.isH2(dbProductName) ? DB_SCHEMA_DETECTION_H2 : DB_SCHEMA_DETECTION_DB2;
|
||||
|
||||
if (DB.isPostgreSql(dbProductName)) {
|
||||
return DB_SCHEMA_DETECTION_POSTGRES;
|
||||
}
|
||||
return DB.isH2(dbProductName) ? DB_SCHEMA_DETECTION_H2 : DB_SCHEMA_DETECTION_DB2;
|
||||
}
|
||||
|
||||
private ScriptRunner getScriptRunnerInstance(Connection connection) {
|
||||
|
|
|
@ -292,11 +292,11 @@ public class LdapCacheTestImpl implements LdapCache {
|
|||
new AccessIdRepresentationModel(
|
||||
"manager_domain_D", "cn=manager_domain_d,ou=groups,o=taskanatest"),
|
||||
new AccessIdRepresentationModel(
|
||||
"teamlead_2", "cn=teamlead_2" + ",ou=groups,o=taskanatest"),
|
||||
"teamlead_2", "cn=teamlead_2,ou=groups,o=taskanatest"),
|
||||
new AccessIdRepresentationModel(
|
||||
"teamlead_4", "cn=teamlead_4" + ",ou=groups,o=taskanatest"),
|
||||
new AccessIdRepresentationModel("team_3", "cn=team_3" + ",ou=groups,o=taskanatest"),
|
||||
new AccessIdRepresentationModel("team_4", "cn=team_4" + ",ou=groups,o=taskanatest")));
|
||||
"teamlead_4", "cn=teamlead_4,ou=groups,o=taskanatest"),
|
||||
new AccessIdRepresentationModel("team_3", "cn=team_3,ou=groups,o=taskanatest"),
|
||||
new AccessIdRepresentationModel("team_4", "cn=team_4,ou=groups,o=taskanatest")));
|
||||
|
||||
@Override
|
||||
public List<AccessIdRepresentationModel> findMatchingAccessId(
|
||||
|
|
Loading…
Reference in New Issue