From ebeacb0e311c52055491748b8abf29af2198973b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E7=A6=B9=E5=85=89?= Date: Sat, 15 Jun 2019 00:16:51 +0800 Subject: [PATCH] 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. --- .../alibaba/nacos/config/server/service/DynamicDataSource.java | 2 +- .../nacos/config/server/service/LocalDataSourceServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/DynamicDataSource.java b/config/src/main/java/com/alibaba/nacos/config/server/service/DynamicDataSource.java index 90f9cd2cd..78f038d22 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/DynamicDataSource.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/DynamicDataSource.java @@ -47,7 +47,7 @@ public class DynamicDataSource implements ApplicationContextAware { public DataSourceService getDataSource() { DataSourceService dataSourceService = null; - if (STANDALONE_MODE && !propertyUtil.isStandaloneUseMysql()) { + if (STANDALONE_MODE && !PropertyUtil.isStandaloneUseMysql()) { dataSourceService = (DataSourceService)applicationContext.getBean("localDataSourceService"); } else { dataSourceService = (DataSourceService)applicationContext.getBean("basicDataSourceService"); diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java index a45f08618..c930a3f1d 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java @@ -90,7 +90,7 @@ public class LocalDataSourceServiceImpl implements DataSourceService { tm.setDataSource(ds); tjt.setTimeout(5000); - if (STANDALONE_MODE && !propertyUtil.isStandaloneUseMysql()) { + if (STANDALONE_MODE && !PropertyUtil.isStandaloneUseMysql()) { reload(); } }