Remove try-with-resources to appease Animal Sniffer.

This commit is contained in:
akwizgran
2018-10-23 14:29:26 +01:00
parent d9b4c013bb
commit dfb581ef12

View File

@@ -146,13 +146,17 @@ class PersistentLogManagerImpl implements PersistentLogManager,
if (oldLogFile.exists()) {
LOG.info("Reading old log file");
List<String> lines = new ArrayList<>();
try (InputStream in = new FileInputStream(oldLogFile)) {
InputStream in = new FileInputStream(oldLogFile);
//noinspection TryFinallyCanBeTryWithResources
try {
InputStream reader = streamReaderFactory
.createLogStreamReader(in, oldLogKey);
Scanner s = new Scanner(reader);
while (s.hasNextLine()) lines.add(s.nextLine());
s.close();
return lines;
} finally {
in.close();
}
} else {
LOG.info("Old log file does not exist");