diff options
author | Chuanyu Chen <chenchuanyu@huawei.com> | 2017-12-18 08:07:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-12-18 08:07:48 +0000 |
commit | 15933ade4f99b72e5c74bd60feac8b9383c02543 (patch) | |
tree | dfb5a4bfefab75ca3d6c447aadbfcab24ee1cfc8 /common | |
parent | ec328042dba6acf13fedc43fb12d659bcca08075 (diff) | |
parent | d52d6366effdbbcb243c06c031fe9f324f16c4a9 (diff) |
Merge "Reduce complexity of HealthCheckUtils"v1.2.0
Diffstat (limited to 'common')
-rw-r--r-- | common/src/main/java/org/openecomp/mso/properties/MsoJavaProperties.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/common/src/main/java/org/openecomp/mso/properties/MsoJavaProperties.java b/common/src/main/java/org/openecomp/mso/properties/MsoJavaProperties.java index 3675dd6178..f0ca191978 100644 --- a/common/src/main/java/org/openecomp/mso/properties/MsoJavaProperties.java +++ b/common/src/main/java/org/openecomp/mso/properties/MsoJavaProperties.java @@ -115,7 +115,6 @@ public class MsoJavaProperties extends AbstractMsoProperties { } finally { this.automaticRefreshInMinutes = this.getIntProperty(RELOAD_TIME_PROPERTY, DEFAULT_RELOAD_TIME_MIN); - // Always close the file try { if (reader != null) { reader.close(); @@ -155,27 +154,31 @@ public class MsoJavaProperties extends AbstractMsoProperties { return false; } MsoJavaProperties other = (MsoJavaProperties) obj; - if (!msoProperties.equals(other.msoProperties)) { - return false; - } - return true; + + return msoProperties.equals(other.msoProperties); } @Override public String toString() { - StringBuffer response = new StringBuffer(); - response.append("Config file " + propertiesFileName + "(Timer:" + automaticRefreshInMinutes + "mins):" - + System.getProperty("line.separator")); + StringBuilder response = new StringBuilder(); + response.append("Config file ") + .append(propertiesFileName) + .append("(Timer:") + .append(automaticRefreshInMinutes) + .append("mins):") + .append(System.lineSeparator()); + for (Object key : this.msoProperties.keySet()) { String propertyName = (String) key; response.append(propertyName); response.append("="); response.append(this.msoProperties.getProperty(propertyName)); - response.append(System.getProperty("line.separator")); + response.append(System.lineSeparator()); } - response.append(System.getProperty("line.separator")); - response.append(System.getProperty("line.separator")); + response.append(System.lineSeparator()); + response.append(System.lineSeparator()); + return response.toString(); } } |