Skip to content

Commit 3378280

Browse files
io7mPascalSchumacher
authored andcommitted
Correct error message in IOUtils (closes #35)
This corrects the wording of the error message in IOUtils: There's no such word as "readed", and the author probably meant "expected" as opposed to "excepted".
1 parent 156653e commit 3378280

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/main/java/org/apache/commons/io/IOUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ public static byte[] toByteArray(final InputStream input, final int size) throws
825825
}
826826

827827
if (offset != size) {
828-
throw new IOException("Unexpected readed size. current: " + offset + ", excepted: " + size);
828+
throw new IOException("Unexpected read size. current: " + offset + ", expected: " + size);
829829
}
830830

831831
return data;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -926,10 +926,10 @@ public synchronized void close() throws IOException {
926926

927927
try (FileInputStream fin = new FileInputStream(m_testFile)) {
928928
IOUtils.toByteArray(fin, m_testFile.length() + 1);
929-
fail("IOException excepted");
929+
fail("IOException expected");
930930
} catch (final IOException exc) {
931-
assertTrue("Exception message does not start with \"Unexpected readed size\"",
932-
exc.getMessage().startsWith("Unexpected readed size"));
931+
assertTrue("Exception message does not start with \"Unexpected read size\"",
932+
exc.getMessage().startsWith("Unexpected read size"));
933933
}
934934

935935
}
@@ -938,7 +938,7 @@ public synchronized void close() throws IOException {
938938

939939
try (FileInputStream fin = new FileInputStream(m_testFile)) {
940940
IOUtils.toByteArray(fin, (long) Integer.MAX_VALUE + 1);
941-
fail("IOException excepted");
941+
fail("IOException expected");
942942
} catch (final IllegalArgumentException exc) {
943943
assertTrue("Exception message does not start with \"Size cannot be greater than Integer max value\"", exc
944944
.getMessage().startsWith("Size cannot be greater than Integer max value"));

0 commit comments

Comments
 (0)