aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java
diff options
context:
space:
mode:
authorkurczews <krzysztof.kurczewski@nokia.com>2017-12-12 15:47:55 +0100
committerkurczews <krzysztof.kurczewski@nokia.com>2017-12-13 08:42:33 +0100
commitd52d6366effdbbcb243c06c031fe9f324f16c4a9 (patch)
tree93917b4e3b9d409ea358deff6dfd21045a5ce12f /common/src/main/java
parent32c33b3a3ee9a76bf2a78662ee36e05ce53a8854 (diff)
Reduce complexity of HealthCheckUtils
* Split bulk conditionals * Split health checks to separate methods * Fix minor issues Issue-ID: SO-353 Change-Id: Ib6298bc488a94aa4fbb253e3894532708547533d Signed-off-by: kurczews <krzysztof.kurczewski@nokia.com>
Diffstat (limited to 'common/src/main/java')
-rw-r--r--common/src/main/java/org/openecomp/mso/properties/MsoJavaProperties.java25
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();
}
}