Code Review
/
policy
/
engine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Updated guard policy documentation"
[policy/engine.git]
/
POLICY-SDK-APP
/
src
/
main
/
java
/
org
/
onap
/
policy
/
controller
/
CreateDcaeMicroServiceController.java
diff --git
a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java
b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java
index
ff5ccff
..
43b62b0
100644
(file)
--- a/
POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java
+++ b/
POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java
@@
-411,23
+411,17
@@
public class CreateDcaeMicroServiceController extends RestrictedBaseController {
}
}
+ @SuppressWarnings("unchecked")
public Map<String, String> load(String fileName) throws IOException {
File newConfiguration = new File(fileName);
public Map<String, String> load(String fileName) throws IOException {
File newConfiguration = new File(fileName);
- InputStream is = null;
- try {
- is = new FileInputStream(newConfiguration);
+ Yaml yaml = new Yaml();
+ Map<Object, Object> yamlMap = null;
+ try(InputStream is = new FileInputStream(newConfiguration)){
+ yamlMap = (Map<Object, Object>) yaml.load(is);
} catch (FileNotFoundException e) {
LOGGER.error(e);
}
} catch (FileNotFoundException e) {
LOGGER.error(e);
}
- Yaml yaml = new Yaml();
-
- Map<Object, Object> yamlMap = null;
- try{
- yamlMap = (Map<Object, Object>) yaml.load(is);
- }catch(Exception e){
- LOGGER.error("load:", e);
- }
StringBuilder sb = new StringBuilder();
Map<String, String> settings = new HashMap<>();
if (yamlMap == null) {
StringBuilder sb = new StringBuilder();
Map<String, String> settings = new HashMap<>();
if (yamlMap == null) {