aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2017-09-26 20:41:58 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-26 20:41:58 +0000
commit89e6bf2638209dbae787677a3fe97d5a4647ea2e (patch)
treeea8cf4d791770d462981d9d26c11e5d6e91115e9
parent98e1c1bad82863b563d59135952a8479764e3874 (diff)
parentb66f9aae658bdb099cef166ba97acd923b87648c (diff)
Merge "Use try-with-resources"
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java17
1 files changed, 5 insertions, 12 deletions
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java
index 4e67bd171d..6059a357b6 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java
@@ -248,19 +248,11 @@ public class PropertyConfiguration {
Map<String, String> properties = new HashMap<>();
Properties newProperties = new Properties();
- FileReader reader = null;
- try {
- reader = new FileReader(file);
+ try (FileReader reader = new FileReader(file)) {
newProperties.load(reader);
- } finally {
- if (reader != null) {
- try {
- reader.close();
- LOGGER.debug("Closed " + fileName);
- } catch (Exception e) {
- LOGGER.debug("Exception :",e);
- }
- }
+ }
+ catch (Exception e) {
+ LOGGER.debug("Exception :",e);
}
for (Entry<Object, Object> entry : newProperties.entrySet()) {
@@ -291,6 +283,7 @@ public class PropertyConfiguration {
interrupt();
}
+ @Override
public void run() {
LOGGER.info(MessageEnum.BPMN_GENERAL_INFO, "BPMN",
"FileWatcherThread started");