diff options
author | AR00500721 <AR00500721@techmahindra.com> | 2019-05-06 18:23:56 +0530 |
---|---|---|
committer | AR00500721 <AR00500721@techmahindra.com> | 2019-05-06 18:23:56 +0530 |
commit | 1fbde0d64a98efcb040cf38b3c1e193019b11b5c (patch) | |
tree | 5ce0a2e40c8eca9ced883af4ffd37f24d3587e90 /UniversalVesAdapter/src/main | |
parent | 6d1902a9731c98d818a948696efbdea2ded852ba (diff) |
Fixing Sonar Blocker issue
Fixing Sonar blocker issue on class FetchDynamicConfig.java
1.FileWriter stream closing at Line157
2.Handling Null pointer Exception at Line179
Sonar Link:https://sonar.onap.org/project/issues?fileUuids=AWkprNOu4d1SZrzfYLdQ&id=org.onap.dcaegen2.services.mapper%3Amapper&open=AWomAhrY4d1SZrzfe8ua&resolved=false&severities=BLOCKER&types=BUG
Issue-ID: DCAEGEN2-1477
Change-Id: Ie016d4811a0e98dc1100079990681b6c55545991
Signed-off-by: AR00500721 <AR00500721@techmahindra.com>
Diffstat (limited to 'UniversalVesAdapter/src/main')
-rw-r--r-- | UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/utils/FetchDynamicConfig.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/utils/FetchDynamicConfig.java b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/utils/FetchDynamicConfig.java index bb9b127..022a586 100644 --- a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/utils/FetchDynamicConfig.java +++ b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/utils/FetchDynamicConfig.java @@ -158,6 +158,7 @@ public class FetchDynamicConfig { PrintWriter printWriter = new PrintWriter(fstream);
printWriter.print(indentedretstring);
printWriter.close();
+ fstream.close();
debugLogger.info("New Config successfully written to local file to " + configFile);
} catch (IOException e) {
@@ -176,7 +177,7 @@ public class FetchDynamicConfig { file = ResourceUtils.getFile("classpath:" + configFileName);
content = new String(Files.readAllBytes(file.toPath()));
} catch (FileNotFoundException e) {
- errorLogger.error("colud not find file :", file.getName());
+ errorLogger.error("colud not find file :",configFileName);
} catch (IOException e) {
errorLogger.error("unable to read the file , reason:", e.getCause());
|