Minor refactoring for tool tasks

- Don't scan for translations on initialization in TranslationPageGenerator in order to speed up startup time of ToolsRunner
- Extract checking for null / empty array of File#listFiles into a separate method
- Move single method of RuntimeUtils into Utils class
This commit is contained in:
ljacqu
2016-10-30 10:43:59 +01:00
parent 195e409efd
commit 46af922fba
10 changed files with 45 additions and 58 deletions
@@ -5,9 +5,6 @@ import com.zaxxer.hikari.HikariDataSource;
import com.zaxxer.hikari.pool.HikariPool.PoolInitializationException;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.data.auth.PlayerAuth;
import fr.xephi.authme.datasource.Columns;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.datasource.DataSourceType;
import fr.xephi.authme.security.HashAlgorithm;
import fr.xephi.authme.security.crypts.HashedPassword;
import fr.xephi.authme.security.crypts.XFBCRYPT;
@@ -15,8 +12,8 @@ import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.properties.DatabaseSettings;
import fr.xephi.authme.settings.properties.HooksSettings;
import fr.xephi.authme.settings.properties.SecuritySettings;
import fr.xephi.authme.util.RuntimeUtils;
import fr.xephi.authme.util.StringUtils;
import fr.xephi.authme.util.Utils;
import java.sql.Blob;
import java.sql.Connection;
@@ -100,8 +97,8 @@ public class MySQL implements DataSource {
this.phpBbGroup = settings.getProperty(HooksSettings.PHPBB_ACTIVATED_GROUP_ID);
this.wordpressPrefix = settings.getProperty(HooksSettings.WORDPRESS_TABLE_PREFIX);
this.poolSize = settings.getProperty(DatabaseSettings.MYSQL_POOL_SIZE);
if(poolSize == -1) {
poolSize = RuntimeUtils.getCoreCount();
if (poolSize == -1) {
poolSize = Utils.getCoreCount();
}
}