Skip to content

Commit 38b9a6a

Browse files
committed
closeQuietly is deprecated
1 parent 1eeef3a commit 38b9a6a

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/test/java/org/apache/commons/io/LineIteratorTestCase.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ private void assertLines(final List<String> lines, final LineIterator iterator)
5454
}
5555
assertFalse(iterator.hasNext(), "No more expected");
5656
} finally {
57-
LineIterator.closeQuietly(iterator);
57+
try {
58+
IOUtils.close(iterator);
59+
} catch (IOException ignored) {
60+
// Ignored
61+
}
5862
}
5963
}
6064

@@ -414,7 +418,11 @@ protected boolean isValidLine(final String line) {
414418
// ignore, expected result
415419
}
416420
} finally {
417-
LineIterator.closeQuietly(iterator);
421+
try {
422+
IOUtils.close(iterator);
423+
} catch (IOException ignored) {
424+
// Ignored
425+
}
418426
}
419427
}
420428

src/test/java/org/apache/commons/io/input/TailerTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,11 @@ protected void createFile(final File file, final long size)
316316
}
317317
}
318318
} finally {
319-
IOUtils.closeQuietly(reader);
319+
try {
320+
IOUtils.close(reader);
321+
} catch (IOException ignored) {
322+
// ignored
323+
}
320324
}
321325
}
322326

0 commit comments

Comments
 (0)