Code Review
/
aai
/
gizmo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix sonar issues in /crud/util/CrudProperties.java
[aai/gizmo.git]
/
src
/
main
/
java
/
org
/
onap
/
crud
/
util
/
CrudProperties.java
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
(file)
--- 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);
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();
properties.store(fileOut, "Added property: " + key);
} catch (Exception e) {
e.printStackTrace();
- } finally {
-
- try {
- fileOut.close();
- } catch (IOException ex) {
- ex.printStackTrace();
- }
}
}
-
}
}