aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSwiton Tomasz <tomasz.switon@nokia.com>2018-06-25 14:35:38 +0200
committerSwiton Tomasz <tomasz.switon@nokia.com>2018-06-25 14:35:38 +0200
commit07c45d4e49c334d11d91bfadbd7b68c437007b01 (patch)
tree6cb4146c1a954abffe7341b745a7dc294eb4fb5a
parent68cd3355674d66f8feee3d067960c081581a3911 (diff)
Fix sonar issues in /crud/util/CrudProperties.java
Change-Id: Id98e68f70af525adc4894bfe92884a590e32b664 Issue-ID: AAI-1240 Signed-off-by: Switon Tomasz <tomasz.switon@nokia.com>
-rw-r--r--src/main/java/org/onap/crud/util/CrudProperties.java12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/main/java/org/onap/crud/util/CrudProperties.java b/src/main/java/org/onap/crud/util/CrudProperties.java
index 7d31691..118aed3 100644
--- a/src/main/java/org/onap/crud/util/CrudProperties.java
+++ b/src/main/java/org/onap/crud/util/CrudProperties.java
@@ -53,21 +53,11 @@ public class CrudProperties {
public static void put(String key, String value) {
properties.setProperty(key, value);
- FileOutputStream fileOut = null;
- try {
- fileOut = new FileOutputStream(new File(CrudServiceConstants.CRD_CONFIG_FILE));
+ try (FileOutputStream fileOut = new FileOutputStream(new File(CrudServiceConstants.CRD_CONFIG_FILE))) {
properties.store(fileOut, "Added property: " + key);
} catch (Exception e) {
e.printStackTrace();
- } finally {
-
- try {
- fileOut.close();
- } catch (IOException ex) {
- ex.printStackTrace();
- }
}
-
}