aboutsummaryrefslogtreecommitdiffstats
path: root/LogParser/src/main
diff options
context:
space:
mode:
authorTej, Tarun <tt3868@att.com>2017-09-07 19:21:28 -0400
committerTej, Tarun <tt3868@att.com>2017-09-08 00:51:01 -0400
commit24c6b1682bb59691f8d5e631b1074355b7d82a54 (patch)
tree50a5db354050faf79ccc7e7e9a08e488163651aa /LogParser/src/main
parent461b2b7eeca1586423349bc0c4c65f80f027292d (diff)
Sonar Fixes
Fixes to the sonar issues along with some cleanup code to remove warnings. Issue-Id: POLICY-113 Change-Id: I826562f7509c346210ac865cc6b31bce26bee2cf Signed-off-by: Tej, Tarun <tt3868@att.com>
Diffstat (limited to 'LogParser/src/main')
-rw-r--r--LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java9
1 files changed, 1 insertions, 8 deletions
diff --git a/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java b/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java
index 461220617..c3d631e1f 100644
--- a/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java
+++ b/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java
@@ -126,20 +126,13 @@ public class ParseLog {
private static boolean processLine(Path debugfilePath, String dataFileName, int lastNmRead, LOGTYPE logType){
// log4jlogger must use .info
- Stream<String> lines = null;
- try {
- lines = Files.lines(debugfilePath, Charset.defaultCharset()).onClose(() -> log4jlogger.info(last+dataFileName+ lineRead + lastNmRead)).skip(lastNmRead);
+ try(Stream<String> lines = Files.lines(debugfilePath, Charset.defaultCharset()).onClose(() -> log4jlogger.info(last+dataFileName+ lineRead + lastNmRead)).skip(lastNmRead)){
lines.forEachOrdered(line -> process(line, type, logType));
} catch (IOException e) {
logger.error(loggingProcess + dataFileName, e);
logger.error(breakLoop);
return true;
- }finally{
- if(lines != null){
- lines.close();
- }
}
-
return false;
}
private static void processDebugLogParser(File debugfile, Path debugfilePath, String dataFileName){