You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/01/19 17:21:57 UTC
[commons-io] branch master updated: Remove unused exceptions.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push:
new 8615c98 Remove unused exceptions.
8615c98 is described below
commit 8615c9818463bec2c6ff0b3db1c455f3692382f7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jan 19 12:21:52 2021 -0500
Remove unused exceptions.
---
.../java/org/apache/commons/io/DemuxTestCase.java | 9 ++----
.../commons/io/FileCleaningTrackerTestCase.java | 15 +++++-----
.../apache/commons/io/FileSystemUtilsTestCase.java | 12 ++++----
.../commons/io/FileUtilsListFilesTestCase.java | 6 ++--
.../apache/commons/io/FilenameUtilsTestCase.java | 12 ++++----
.../java/org/apache/commons/io/IOCaseTestCase.java | 32 +++++++++++-----------
.../org/apache/commons/io/IOUtilsCopyTestCase.java | 28 +++++++++----------
.../org/apache/commons/io/IOUtilsTestCase.java | 4 +--
.../apache/commons/io/LineIteratorTestCase.java | 2 +-
9 files changed, 60 insertions(+), 60 deletions(-)
diff --git a/src/test/java/org/apache/commons/io/DemuxTestCase.java b/src/test/java/org/apache/commons/io/DemuxTestCase.java
index 7a3ab08..1bcfca5 100644
--- a/src/test/java/org/apache/commons/io/DemuxTestCase.java
+++ b/src/test/java/org/apache/commons/io/DemuxTestCase.java
@@ -65,8 +65,7 @@ public class DemuxTestCase {
return thread.getData();
}
- private void doStart()
- throws Exception {
+ private void doStart() {
for (final String name : m_threadMap.keySet()) {
final Thread thread = m_threadMap.get(name);
thread.start();
@@ -83,8 +82,7 @@ public class DemuxTestCase {
private void startWriter(final String name,
final String data,
- final DemuxOutputStream demux)
- throws Exception {
+ final DemuxOutputStream demux) {
final ByteArrayOutputStream output = new ByteArrayOutputStream();
m_outputMap.put(name, output);
final WriterThread thread =
@@ -94,8 +92,7 @@ public class DemuxTestCase {
private void startReader(final String name,
final String data,
- final DemuxInputStream demux)
- throws Exception {
+ final DemuxInputStream demux) {
final ByteArrayInputStream input = new ByteArrayInputStream(data.getBytes());
final ReaderThread thread = new ReaderThread(name, input, demux);
m_threadMap.put(name, thread);
diff --git a/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java b/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java
index f1a8b57..f6d5a6f 100644
--- a/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java
+++ b/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java
@@ -53,14 +53,16 @@ public class FileCleaningTrackerTestCase {
private File testFile;
private FileCleaningTracker theInstance;
+ /**
+ */
@BeforeEach
- public void setUp() throws Exception {
+ public void setUp() {
testFile = new File(temporaryFolder, "file-test.txt");
theInstance = newInstance();
}
@AfterEach
- public void tearDown() throws Exception {
+ public void tearDown() {
// reset file cleaner class, so as not to break other tests
@@ -175,7 +177,7 @@ public class FileCleaningTrackerTestCase {
}
@Test
- public void testFileCleanerNull() throws Exception {
+ public void testFileCleanerNull() {
try {
theInstance.track((File) null, new Object());
fail();
@@ -217,7 +219,7 @@ public class FileCleaningTrackerTestCase {
}
@Test
- public void testFileCleanerExitWhenFinished_NoTrackAfter() throws Exception {
+ public void testFileCleanerExitWhenFinished_NoTrackAfter() {
assertFalse(theInstance.exitWhenFinished);
theInstance.exitWhenFinished();
assertTrue(theInstance.exitWhenFinished);
@@ -313,12 +315,11 @@ public class FileCleaningTrackerTestCase {
file = new File(file.getPath());
}
}
- private String showFailures() throws Exception {
+ private String showFailures() {
if (theInstance.deleteFailures.size() == 1) {
return "[Delete Failed: " + theInstance.deleteFailures.get(0) + "]";
- } else {
- return "[Delete Failures: " + theInstance.deleteFailures.size() + "]";
}
+ return "[Delete Failures: " + theInstance.deleteFailures.size() + "]";
}
private void waitUntilTrackCount() throws Exception {
diff --git a/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java b/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java
index b07742f..8516b30 100644
--- a/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java
@@ -294,7 +294,7 @@ public class FileSystemUtilsTestCase {
}
@Test
- public void testGetFreeSpaceWindows_String_EmptyResponse() throws Exception {
+ public void testGetFreeSpaceWindows_String_EmptyResponse() {
final String lines = "";
final FileSystemUtils fsu = new MockFileSystemUtils(0, lines);
try {
@@ -435,7 +435,7 @@ public class FileSystemUtilsTestCase {
}
@Test
- public void testGetFreeSpaceUnix_String_EmptyResponse() throws Exception {
+ public void testGetFreeSpaceUnix_String_EmptyResponse() {
final String lines = "";
final FileSystemUtils fsu = new MockFileSystemUtils(0, lines);
try {
@@ -461,7 +461,7 @@ public class FileSystemUtilsTestCase {
}
@Test
- public void testGetFreeSpaceUnix_String_InvalidResponse1() throws Exception {
+ public void testGetFreeSpaceUnix_String_InvalidResponse1() {
final String lines =
"Filesystem 1K-blocks Used Available Use% Mounted on\n" +
" 14428928 12956424 100";
@@ -489,7 +489,7 @@ public class FileSystemUtilsTestCase {
}
@Test
- public void testGetFreeSpaceUnix_String_InvalidResponse2() throws Exception {
+ public void testGetFreeSpaceUnix_String_InvalidResponse2() {
final String lines =
"Filesystem 1K-blocks Used Available Use% Mounted on\n" +
"xxx:/home/users/s 14428928 12956424 nnnnnnn 90% /home/users/s";
@@ -517,7 +517,7 @@ public class FileSystemUtilsTestCase {
}
@Test
- public void testGetFreeSpaceUnix_String_InvalidResponse3() throws Exception {
+ public void testGetFreeSpaceUnix_String_InvalidResponse3() {
final String lines =
"Filesystem 1K-blocks Used Available Use% Mounted on\n" +
"xxx:/home/users/s 14428928 12956424 -1 90% /home/users/s";
@@ -545,7 +545,7 @@ public class FileSystemUtilsTestCase {
}
@Test
- public void testGetFreeSpaceUnix_String_InvalidResponse4() throws Exception {
+ public void testGetFreeSpaceUnix_String_InvalidResponse4() {
final String lines =
"Filesystem 1K-blocks Used Available Use% Mounted on\n" +
"xxx-yyyyyyy-zzz:/home/users/s";
diff --git a/src/test/java/org/apache/commons/io/FileUtilsListFilesTestCase.java b/src/test/java/org/apache/commons/io/FileUtilsListFilesTestCase.java
index 5d1cdbe..a3905b2 100644
--- a/src/test/java/org/apache/commons/io/FileUtilsListFilesTestCase.java
+++ b/src/test/java/org/apache/commons/io/FileUtilsListFilesTestCase.java
@@ -89,7 +89,7 @@ public class FileUtilsListFilesTestCase {
}
@Test
- public void testIterateFilesByExtension() throws Exception {
+ public void testIterateFilesByExtension() {
final String[] extensions = { "xml", "txt" };
Iterator<File> files = FileUtils.iterateFiles(temporaryFolder, extensions, false);
@@ -114,7 +114,7 @@ public class FileUtilsListFilesTestCase {
}
@Test
- public void testListFilesByExtension() throws Exception {
+ public void testListFilesByExtension() {
final String[] extensions = {"xml", "txt"};
Collection<File> files = FileUtils.listFiles(temporaryFolder, extensions, false);
@@ -139,7 +139,7 @@ public class FileUtilsListFilesTestCase {
}
@Test
- public void testListFiles() throws Exception {
+ public void testListFiles() {
Collection<File> files;
Collection<String> filenames;
IOFileFilter fileFilter;
diff --git a/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java b/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
index 5a6599e..295046e 100644
--- a/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
@@ -98,7 +98,7 @@ public class FilenameUtilsTestCase {
//-----------------------------------------------------------------------
@Test
- public void testNormalize() throws Exception {
+ public void testNormalize() {
assertEquals(null, FilenameUtils.normalize(null));
assertEquals(null, FilenameUtils.normalize(":"));
assertEquals(null, FilenameUtils.normalize("1:\\a\\b\\c.txt"));
@@ -274,8 +274,10 @@ public class FilenameUtilsTestCase {
assertEquals(null, FilenameUtils.normalize("\\\\1:2\\a\\b\\c.txt"));
}
+ /**
+ */
@Test
- public void testNormalize_with_nullbytes() throws Exception {
+ public void testNormalize_with_nullbytes() {
try {
assertEquals("a" + SEP + "b" + SEP + "c.txt", FilenameUtils.normalize("a\\b/c\u0000.txt"));
} catch (final IllegalArgumentException ignore) {
@@ -288,7 +290,7 @@ public class FilenameUtilsTestCase {
}
@Test
- public void testNormalizeUnixWin() throws Exception {
+ public void testNormalizeUnixWin() {
// Normalize (Unix Separator)
assertEquals("/a/c/", FilenameUtils.normalize("/a/b/../c/", true));
@@ -301,7 +303,7 @@ public class FilenameUtilsTestCase {
//-----------------------------------------------------------------------
@Test
- public void testNormalizeNoEndSeparator() throws Exception {
+ public void testNormalizeNoEndSeparator() {
assertEquals(null, FilenameUtils.normalizeNoEndSeparator(null));
assertEquals(null, FilenameUtils.normalizeNoEndSeparator(":"));
assertEquals(null, FilenameUtils.normalizeNoEndSeparator("1:\\a\\b\\c.txt"));
@@ -451,7 +453,7 @@ public class FilenameUtilsTestCase {
}
@Test
- public void testNormalizeNoEndSeparatorUnixWin() throws Exception {
+ public void testNormalizeNoEndSeparatorUnixWin() {
// Normalize (Unix Separator)
assertEquals("/a/c", FilenameUtils.normalizeNoEndSeparator("/a/b/../c/", true));
diff --git a/src/test/java/org/apache/commons/io/IOCaseTestCase.java b/src/test/java/org/apache/commons/io/IOCaseTestCase.java
index 58781a4..6f5acaa 100644
--- a/src/test/java/org/apache/commons/io/IOCaseTestCase.java
+++ b/src/test/java/org/apache/commons/io/IOCaseTestCase.java
@@ -40,7 +40,7 @@ public class IOCaseTestCase {
//-----------------------------------------------------------------------
@Test
- public void test_forName() throws Exception {
+ public void test_forName() {
assertEquals(IOCase.SENSITIVE, IOCase.forName("Sensitive"));
assertEquals(IOCase.INSENSITIVE, IOCase.forName("Insensitive"));
assertEquals(IOCase.SYSTEM, IOCase.forName("System"));
@@ -62,28 +62,28 @@ public class IOCaseTestCase {
}
@Test
- public void test_getName() throws Exception {
+ public void test_getName() {
assertEquals("Sensitive", IOCase.SENSITIVE.getName());
assertEquals("Insensitive", IOCase.INSENSITIVE.getName());
assertEquals("System", IOCase.SYSTEM.getName());
}
@Test
- public void test_toString() throws Exception {
+ public void test_toString() {
assertEquals("Sensitive", IOCase.SENSITIVE.toString());
assertEquals("Insensitive", IOCase.INSENSITIVE.toString());
assertEquals("System", IOCase.SYSTEM.toString());
}
@Test
- public void test_isCaseSensitive() throws Exception {
+ public void test_isCaseSensitive() {
assertTrue(IOCase.SENSITIVE.isCaseSensitive());
assertFalse(IOCase.INSENSITIVE.isCaseSensitive());
assertEquals(!WINDOWS, IOCase.SYSTEM.isCaseSensitive());
}
//-----------------------------------------------------------------------
@Test
- public void test_checkCompare_functionality() throws Exception {
+ public void test_checkCompare_functionality() {
assertTrue(IOCase.SENSITIVE.checkCompareTo("ABC", "") > 0);
assertTrue(IOCase.SENSITIVE.checkCompareTo("", "ABC") < 0);
assertTrue(IOCase.SENSITIVE.checkCompareTo("ABC", "DEF") < 0);
@@ -106,7 +106,7 @@ public class IOCaseTestCase {
}
@Test
- public void test_checkCompare_case() throws Exception {
+ public void test_checkCompare_case() {
assertEquals(0, IOCase.SENSITIVE.checkCompareTo("ABC", "ABC"));
assertTrue(IOCase.SENSITIVE.checkCompareTo("ABC", "abc") < 0);
assertTrue(IOCase.SENSITIVE.checkCompareTo("abc", "ABC") > 0);
@@ -123,7 +123,7 @@ public class IOCaseTestCase {
//-----------------------------------------------------------------------
@Test
- public void test_checkEquals_functionality() throws Exception {
+ public void test_checkEquals_functionality() {
assertFalse(IOCase.SENSITIVE.checkEquals("ABC", ""));
assertFalse(IOCase.SENSITIVE.checkEquals("ABC", "A"));
assertFalse(IOCase.SENSITIVE.checkEquals("ABC", "AB"));
@@ -149,7 +149,7 @@ public class IOCaseTestCase {
}
@Test
- public void test_checkEquals_case() throws Exception {
+ public void test_checkEquals_case() {
assertTrue(IOCase.SENSITIVE.checkEquals("ABC", "ABC"));
assertFalse(IOCase.SENSITIVE.checkEquals("ABC", "Abc"));
@@ -162,7 +162,7 @@ public class IOCaseTestCase {
//-----------------------------------------------------------------------
@Test
- public void test_checkStartsWith_functionality() throws Exception {
+ public void test_checkStartsWith_functionality() {
assertTrue(IOCase.SENSITIVE.checkStartsWith("ABC", ""));
assertTrue(IOCase.SENSITIVE.checkStartsWith("ABC", "A"));
assertTrue(IOCase.SENSITIVE.checkStartsWith("ABC", "AB"));
@@ -179,7 +179,7 @@ public class IOCaseTestCase {
}
@Test
- public void test_checkStartsWith_case() throws Exception {
+ public void test_checkStartsWith_case() {
assertTrue(IOCase.SENSITIVE.checkStartsWith("ABC", "AB"));
assertFalse(IOCase.SENSITIVE.checkStartsWith("ABC", "Ab"));
@@ -192,7 +192,7 @@ public class IOCaseTestCase {
//-----------------------------------------------------------------------
@Test
- public void test_checkEndsWith_functionality() throws Exception {
+ public void test_checkEndsWith_functionality() {
assertTrue(IOCase.SENSITIVE.checkEndsWith("ABC", ""));
assertFalse(IOCase.SENSITIVE.checkEndsWith("ABC", "A"));
assertFalse(IOCase.SENSITIVE.checkEndsWith("ABC", "AB"));
@@ -209,7 +209,7 @@ public class IOCaseTestCase {
}
@Test
- public void test_checkEndsWith_case() throws Exception {
+ public void test_checkEndsWith_case() {
assertTrue(IOCase.SENSITIVE.checkEndsWith("ABC", "BC"));
assertFalse(IOCase.SENSITIVE.checkEndsWith("ABC", "Bc"));
@@ -222,7 +222,7 @@ public class IOCaseTestCase {
//-----------------------------------------------------------------------
@Test
- public void test_checkIndexOf_functionality() throws Exception {
+ public void test_checkIndexOf_functionality() {
// start
assertEquals(0, IOCase.SENSITIVE.checkIndexOf("ABCDEFGHIJ", 0, "A"));
@@ -275,7 +275,7 @@ public class IOCaseTestCase {
}
@Test
- public void test_checkIndexOf_case() throws Exception {
+ public void test_checkIndexOf_case() {
assertEquals(1, IOCase.SENSITIVE.checkIndexOf("ABC", 0, "BC"));
assertEquals(-1, IOCase.SENSITIVE.checkIndexOf("ABC", 0, "Bc"));
@@ -288,7 +288,7 @@ public class IOCaseTestCase {
//-----------------------------------------------------------------------
@Test
- public void test_checkRegionMatches_functionality() throws Exception {
+ public void test_checkRegionMatches_functionality() {
assertTrue(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, ""));
assertTrue(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "A"));
assertTrue(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "AB"));
@@ -336,7 +336,7 @@ public class IOCaseTestCase {
}
@Test
- public void test_checkRegionMatches_case() throws Exception {
+ public void test_checkRegionMatches_case() {
assertTrue(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "AB"));
assertFalse(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "Ab"));
diff --git a/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java b/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java
index f40307b..5eb5b42 100644
--- a/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java
+++ b/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java
@@ -97,13 +97,13 @@ public class IOUtilsCopyTestCase {
}
@Test
- public void testCopy_inputStreamToOutputStream_nullIn() throws Exception {
+ public void testCopy_inputStreamToOutputStream_nullIn() {
final OutputStream out = new ByteArrayOutputStream();
assertThrows(NullPointerException.class, () -> IOUtils.copy((InputStream) null, out));
}
@Test
- public void testCopy_inputStreamToOutputStream_nullOut() throws Exception {
+ public void testCopy_inputStreamToOutputStream_nullOut() {
final InputStream in = new ByteArrayInputStream(inData);
assertThrows(NullPointerException.class, () -> IOUtils.copy(in, (OutputStream) null));
}
@@ -204,7 +204,7 @@ public class IOUtilsCopyTestCase {
}
@Test
- public void testCopy_inputStreamToWriter_Encoding_nullIn() throws Exception {
+ public void testCopy_inputStreamToWriter_Encoding_nullIn() {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
final OutputStream out = new ThrowOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(out, StandardCharsets.US_ASCII);
@@ -212,14 +212,14 @@ public class IOUtilsCopyTestCase {
}
@Test
- public void testCopy_inputStreamToWriter_Encoding_nullOut() throws Exception {
+ public void testCopy_inputStreamToWriter_Encoding_nullOut() {
final InputStream in = new ByteArrayInputStream(inData);
assertThrows(NullPointerException.class, () -> IOUtils.copy(in, null, "UTF8"));
}
@SuppressWarnings("deprecation") // deliberately testing deprecated method
@Test
- public void testCopy_inputStreamToWriter_nullIn() throws Exception {
+ public void testCopy_inputStreamToWriter_nullIn() {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
final OutputStream out = new ThrowOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(out, StandardCharsets.US_ASCII);
@@ -228,7 +228,7 @@ public class IOUtilsCopyTestCase {
@SuppressWarnings("deprecation") // deliberately testing deprecated method
@Test
- public void testCopy_inputStreamToWriter_nullOut() throws Exception {
+ public void testCopy_inputStreamToWriter_nullOut() {
final InputStream in = new ByteArrayInputStream(inData);
assertThrows(NullPointerException.class, () -> IOUtils.copy(in, (Writer) null)); // deliberately testing deprecated method
}
@@ -270,7 +270,7 @@ public class IOUtilsCopyTestCase {
}
@Test
- public void testCopy_readerToAppendable_nullIn() throws Exception {
+ public void testCopy_readerToAppendable_nullIn() {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
final OutputStream out = new ThrowOnFlushAndCloseOutputStream(baout, true, true);
final Appendable writer = new OutputStreamWriter(out, StandardCharsets.US_ASCII);
@@ -279,7 +279,7 @@ public class IOUtilsCopyTestCase {
@SuppressWarnings("resource") // 'in' is deliberately not closed
@Test
- public void testCopy_readerToAppendable_nullOut() throws Exception {
+ public void testCopy_readerToAppendable_nullOut() {
InputStream in = new ByteArrayInputStream(inData);
in = new ThrowOnCloseInputStream(in);
final Reader reader = new InputStreamReader(in, StandardCharsets.US_ASCII);
@@ -348,7 +348,7 @@ public class IOUtilsCopyTestCase {
}
@Test
- public void testCopy_readerToOutputStream_Encoding_nullIn() throws Exception {
+ public void testCopy_readerToOutputStream_Encoding_nullIn() {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
final OutputStream out = new ThrowOnFlushAndCloseOutputStream(baout, true, true);
assertThrows(NullPointerException.class, () -> IOUtils.copy(null, out, "UTF16"));
@@ -356,7 +356,7 @@ public class IOUtilsCopyTestCase {
@SuppressWarnings("resource") // 'in' is deliberately not closed
@Test
- public void testCopy_readerToOutputStream_Encoding_nullOut() throws Exception {
+ public void testCopy_readerToOutputStream_Encoding_nullOut() {
InputStream in = new ByteArrayInputStream(inData);
in = new ThrowOnCloseInputStream(in);
final Reader reader = new InputStreamReader(in, StandardCharsets.US_ASCII);
@@ -365,7 +365,7 @@ public class IOUtilsCopyTestCase {
@SuppressWarnings("deprecation")
@Test
- public void testCopy_readerToOutputStream_nullIn() throws Exception { // deliberately testing deprecated method
+ public void testCopy_readerToOutputStream_nullIn() { // deliberately testing deprecated method
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
final OutputStream out = new ThrowOnFlushAndCloseOutputStream(baout, true, true);
assertThrows(NullPointerException.class, () -> IOUtils.copy((Reader) null, out));
@@ -373,7 +373,7 @@ public class IOUtilsCopyTestCase {
@SuppressWarnings({ "resource", "deprecation" }) // 'in' is deliberately not closed
@Test
- public void testCopy_readerToOutputStream_nullOut() throws Exception {
+ public void testCopy_readerToOutputStream_nullOut() {
InputStream in = new ByteArrayInputStream(inData);
in = new ThrowOnCloseInputStream(in);
final Reader reader = new InputStreamReader(in, StandardCharsets.US_ASCII);
@@ -421,7 +421,7 @@ public class IOUtilsCopyTestCase {
}
@Test
- public void testCopy_readerToWriter_nullIn() throws Exception {
+ public void testCopy_readerToWriter_nullIn() {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
final OutputStream out = new ThrowOnFlushAndCloseOutputStream(baout, true, true);
final Writer writer = new OutputStreamWriter(out, StandardCharsets.US_ASCII);
@@ -430,7 +430,7 @@ public class IOUtilsCopyTestCase {
@SuppressWarnings("resource") // 'in' is deliberately not closed
@Test
- public void testCopy_readerToWriter_nullOut() throws Exception {
+ public void testCopy_readerToWriter_nullOut() {
InputStream in = new ByteArrayInputStream(inData);
in = new ThrowOnCloseInputStream(in);
final Reader reader = new InputStreamReader(in, StandardCharsets.US_ASCII);
diff --git a/src/test/java/org/apache/commons/io/IOUtilsTestCase.java b/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
index 7f86b00..8e8a8c0 100644
--- a/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
@@ -471,7 +471,7 @@ public class IOUtilsTestCase {
}
@Test
- public void testConstants() throws Exception {
+ public void testConstants() {
assertEquals('/', IOUtils.DIR_SEPARATOR_UNIX);
assertEquals('\\', IOUtils.DIR_SEPARATOR_WINDOWS);
assertEquals("\n", IOUtils.LINE_SEPARATOR_UNIX);
@@ -776,7 +776,7 @@ public class IOUtilsTestCase {
}
@Test
- public void testCopyLarge_CharSkipInvalid() throws IOException {
+ public void testCopyLarge_CharSkipInvalid() {
try (CharArrayReader is = new CharArrayReader(carr); CharArrayWriter os = new CharArrayWriter()) {
assertThrows(EOFException.class, () -> IOUtils.copyLarge(is, os, 1000, 100));
}
diff --git a/src/test/java/org/apache/commons/io/LineIteratorTestCase.java b/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
index 0796460..22eda6c 100644
--- a/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
+++ b/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
@@ -110,7 +110,7 @@ public class LineIteratorTestCase {
// -----------------------------------------------------------------------
@Test
- public void testConstructor() throws Exception {
+ public void testConstructor() {
assertThrows(IllegalArgumentException.class, () -> {
try (
LineIterator li = new LineIterator(null)