Avoid accessing static variables or static methods of this class through object references of a class. It increases the cost of compiler parsing and can be accessed directly by class name.

This commit is contained in:
赵禹光 2019-06-15 00:16:51 +08:00
parent bce13d20ac
commit ebeacb0e31
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ public class DynamicDataSource implements ApplicationContextAware {
public DataSourceService getDataSource() { public DataSourceService getDataSource() {
DataSourceService dataSourceService = null; DataSourceService dataSourceService = null;
if (STANDALONE_MODE && !propertyUtil.isStandaloneUseMysql()) { if (STANDALONE_MODE && !PropertyUtil.isStandaloneUseMysql()) {
dataSourceService = (DataSourceService)applicationContext.getBean("localDataSourceService"); dataSourceService = (DataSourceService)applicationContext.getBean("localDataSourceService");
} else { } else {
dataSourceService = (DataSourceService)applicationContext.getBean("basicDataSourceService"); dataSourceService = (DataSourceService)applicationContext.getBean("basicDataSourceService");

View File

@ -90,7 +90,7 @@ public class LocalDataSourceServiceImpl implements DataSourceService {
tm.setDataSource(ds); tm.setDataSource(ds);
tjt.setTimeout(5000); tjt.setTimeout(5000);
if (STANDALONE_MODE && !propertyUtil.isStandaloneUseMysql()) { if (STANDALONE_MODE && !PropertyUtil.isStandaloneUseMysql()) {
reload(); reload();
} }
} }