Browse Source

Optimize PropertyUtils instantiation. (#2199)

* Optimize PropertyUtils instantiation.

* Fix info error.
pull/2/head
t1mon 5 years ago committed by GitHub
parent
commit
7dd126da71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/PropertyUtils.java

8
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() {
throw new IllegalStateException("PropertyUtils class");
private PropertyUtils(){
init();
} }
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