summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sli/recording/src/main/java/org/onap/ccsdk/sli/core/sli/recording/FileRecorder.java18
1 files changed, 2 insertions, 16 deletions
diff --git a/sli/recording/src/main/java/org/onap/ccsdk/sli/core/sli/recording/FileRecorder.java b/sli/recording/src/main/java/org/onap/ccsdk/sli/core/sli/recording/FileRecorder.java
index 772906e5..ac3dbd2a 100644
--- a/sli/recording/src/main/java/org/onap/ccsdk/sli/core/sli/recording/FileRecorder.java
+++ b/sli/recording/src/main/java/org/onap/ccsdk/sli/core/sli/recording/FileRecorder.java
@@ -82,7 +82,6 @@ public class FileRecorder implements SvcLogicRecorder {
}
File recordFile = new File(fileName);
- FileWriter fileWriter = null;
Date now = new Date();
TimeZone tz = TimeZone.getTimeZone("UTC");
@@ -93,8 +92,8 @@ public class FileRecorder implements SvcLogicRecorder {
record = record.replaceFirst("__TIMESTAMP__", dateFmt.format(now));
}
- try ( PrintWriter recPrinter = new PrintWriter(fileWriter = new
- FileWriter(recordFile, true)))
+ try ( FileWriter fileWriter = new FileWriter(recordFile, true);
+ PrintWriter recPrinter = new PrintWriter(fileWriter))
{
recPrinter.println(record);
}
@@ -102,19 +101,6 @@ public class FileRecorder implements SvcLogicRecorder {
{
throw new SvcLogicException("Cannot write record to file", e);
}
- finally
- {
- if (fileWriter != null)
- {
- try {
- fileWriter.close();
- } catch (IOException e) {
-
- }
- }
- }
-
-
}
}