Browse Source

Optimize PropertyUtils instantiation. (#2199)

* Optimize PropertyUtils instantiation.

* Fix info error.
pull/3/MERGE
t1mon 5 years ago committed by gaojun2048
parent
commit
9c754378f3
  1. 6
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/PropertyUtils.java

6
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/PropertyUtils.java

@ -43,13 +43,11 @@ public class PropertyUtils {
private static final Properties properties = new Properties(); private static final Properties properties = new Properties();
private static final PropertyUtils propertyUtils = new PropertyUtils();
private PropertyUtils() { private PropertyUtils() {
init(); throw new IllegalStateException("PropertyUtils class");
} }
private void init(){ static {
String[] propertyFiles = new String[]{COMMON_PROPERTIES_PATH}; String[] propertyFiles = new String[]{COMMON_PROPERTIES_PATH};
for (String fileName : propertyFiles) { for (String fileName : propertyFiles) {
InputStream fis = null; InputStream fis = null;

Loading…
Cancel
Save