diff options
Diffstat (limited to 'LogParser/src/main')
-rw-r--r-- | LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java | 9 |
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){ |