diff options
author | Parshad Patel <pars.patel@samsung.com> | 2018-11-05 14:17:15 +0900 |
---|---|---|
committer | Michael Lando <michael.lando@intl.att.com> | 2018-11-08 12:08:27 +0000 |
commit | 2ab341a8851e3b54afc93c7c60818a85ada49753 (patch) | |
tree | 47d31641ad7720d515b3145ddeed4d18ba1357d5 /src/main | |
parent | 5533148146d08c30048389d4c76d02b86ad1221c (diff) |
Fix sonar issue in sdc/dcae-d/ci1.2.0casablanca
Fix use try-with-resources issue in ExtentManager.java
Issue-ID: SDC-1895
Change-Id: I838dbf8cfa64bb49ddeb0481be39da8b6847cd81
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/onap/dcae/ci/report/ExtentManager.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/main/java/org/onap/dcae/ci/report/ExtentManager.java b/src/main/java/org/onap/dcae/ci/report/ExtentManager.java index ae6e52d..e5cd442 100644 --- a/src/main/java/org/onap/dcae/ci/report/ExtentManager.java +++ b/src/main/java/org/onap/dcae/ci/report/ExtentManager.java @@ -85,13 +85,10 @@ public class ExtentManager { private static void createVersionsInfoFile(String path, String file, String envData, String suiteName) { File myFoo = new File(path + file); - FileOutputStream fooStream; - try { - fooStream = new FileOutputStream(myFoo, false); + try(FileOutputStream fooStream = new FileOutputStream(myFoo, false)) { String versions = ("env=\"" + envData + "\"\n" + "suiteName=\"" + suiteName + "\"\n"); byte[] myBytes = versions.getBytes(); fooStream.write(myBytes); - fooStream.close(); } catch (IOException e) { e.printStackTrace(); } |