Skip to content

Commit 9f00748

Browse files
authored
Fix Typos in JavaDoc, Comments and Tests (#201)
* Fixed incorrect/missing JavaDoc. * Fixed misc. typos in comments and tests. * Fixed typos in exception messages.
1 parent 7a7b141 commit 9f00748

13 files changed

Lines changed: 17 additions & 17 deletions

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ public static Collection<File> listFilesAndDirs(
21922192
* @throws IOException if the directory was not created along with all its parent directories.
21932193
* @throws IOException if the given file object is not a directory.
21942194
* @throws SecurityException See {@link File#mkdirs()}.
2195-
* @see @see File#mkdirs()
2195+
* @see File#mkdirs()
21962196
*/
21972197
private static File mkdirs(final File directory) throws IOException {
21982198
if (directory != null) {
@@ -2625,7 +2625,7 @@ private static void requireCanWrite(final File file, final String name) {
26252625
* Requires that the given {@code File} is a directory.
26262626
*
26272627
* @param directory The {@code File} to check.
2628-
* @param name
2628+
* @param name The parameter name to use in the exception message in case of null input or if the file is not a directory.
26292629
* @return the given directory.
26302630
* @throws NullPointerException if the given {@code File} is {@code null}.
26312631
* @throws IllegalArgumentException if the given {@code File} does not exist or is not a directory.
@@ -3052,7 +3052,7 @@ private static int toMaxDepth(final boolean recursive) {
30523052
*
30533053
* @param extensions an array of extensions. Format: {"java", "xml"}
30543054
* @return an array of suffixes. Format: {".java", ".xml"}
3055-
* @throws NullPointerException
3055+
* @throws NullPointerException if the parameter is null
30563056
*/
30573057
private static String[] toSuffixes(final String... extensions) {
30583058
Objects.requireNonNull(extensions, "extensions");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@ public static boolean wildcardMatch(final String fileName, final String wildcard
14301430
} else {
14311431
// matching from current position
14321432
if (!caseSensitivity.checkRegionMatches(fileName, textIdx, wcs[wcsIdx])) {
1433-
// couldnt match token
1433+
// couldn't match token
14341434
break;
14351435
}
14361436
}

src/main/java/org/apache/commons/io/input/XmlStreamReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ public XmlStreamReader(final URL url) throws IOException {
512512
* the URLConnection.
513513
*/
514514
public XmlStreamReader(final URLConnection conn, final String defaultEncoding) throws IOException {
515-
Objects.requireNonNull(conn, "conm");
515+
Objects.requireNonNull(conn, "conn");
516516
this.defaultEncoding = defaultEncoding;
517517
final boolean lenient = true;
518518
final String contentType = conn.getContentType();

src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ protected void writeToImpl(final OutputStream out) throws IOException {
301301
* @see #reset()
302302
* @since 2.7
303303
*/
304-
@SuppressWarnings("resource") // The result InputStream MUIST be managed by the call site.
304+
@SuppressWarnings("resource") // The result InputStream MUST be managed by the call site.
305305
protected <T extends InputStream> InputStream toInputStream(
306306
final InputStreamConstructor<T> isConstructor) {
307307
int remaining = count;

src/main/java/org/apache/commons/io/output/WriterOutputStream.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,14 @@ private static void checkIbmJdkWithBrokenUTF16(final Charset charset){
333333
try {
334334
charsetDecoder2.decode(bb2, cb2, i == (len - 1));
335335
} catch ( final IllegalArgumentException e){
336-
throw new UnsupportedOperationException("UTF-16 requested when runninng on an IBM JDK with broken UTF-16 support. " +
336+
throw new UnsupportedOperationException("UTF-16 requested when running on an IBM JDK with broken UTF-16 support. " +
337337
"Please find a JDK that supports UTF-16 if you intend to use UF-16 with WriterOutputStream");
338338
}
339339
bb2.compact();
340340
}
341341
cb2.rewind();
342342
if (!TEST_STRING_2.equals(cb2.toString())){
343-
throw new UnsupportedOperationException("UTF-16 requested when runninng on an IBM JDK with broken UTF-16 support. " +
343+
throw new UnsupportedOperationException("UTF-16 requested when running on an IBM JDK with broken UTF-16 support. " +
344344
"Please find a JDK that supports UTF-16 if you intend to use UF-16 with WriterOutputStream");
345345
}
346346

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void testGetFreeSpace_String() throws Exception {
7272
final long kb = FileSystemUtils.freeSpaceKb("/");
7373
// Assume disk space does not fluctuate
7474
// more than 1% between the above two calls;
75-
// this also also small enough to verifiy freeSpaceKb uses
75+
// this also also small enough to verify freeSpaceKb uses
7676
// kibibytes (1024) instead of SI kilobytes (1000)
7777
final double acceptableDelta = kb * 0.01d;
7878
if (kilobyteBlock) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public void testFileDoesNotExistBug() throws IOException {
156156
final File file = new File(top, "DOESNOTEXIST");
157157
assertTrue(top.exists(), "Check directory exists");
158158
assertFalse(file.exists(), "Check file does not exist");
159-
assertFalse(FileUtils.directoryContains(top, file), "Direcory does not contain unrealized file");
159+
assertFalse(FileUtils.directoryContains(top, file), "Directory does not contain unrealized file");
160160
}
161161

162162
@Test

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* Tests functionality of {@link BufferedFileChannelInputStream}.
2626
*
27-
* This class was ported and adapted from Apache Spark commit 933dc6cb7b3de1d8ccaf73d124d6eb95b947ed19 wher it was
27+
* This class was ported and adapted from Apache Spark commit 933dc6cb7b3de1d8ccaf73d124d6eb95b947ed19 where it was
2828
* called {@code BufferedFileChannelInputStreamSuite}.
2929
*/
3030
public class BufferedFileChannelInputStreamTest extends AbstractInputStreamTest {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void testRead() throws Exception {
4646
}
4747
assertEquals(0, input.available(), "Available after contents all read");
4848

49-
// Check availabale is zero after End of file
49+
// Check available is zero after End of file
5050
assertEquals(-1, input.read(), "End of File");
5151
assertEquals(0, input.available(), "Available after End of File");
5252

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ protected InputStream getXmlStream(final String bomType, final String xmlType,
481481
final String xmlDoc = getXML(bomType, xmlType, streamEnc, prologEnc);
482482
writer.write(xmlDoc);
483483

484-
// PADDDING TO TEST THINGS WORK BEYOND PUSHBACK_SIZE
484+
// PADDING TO TEST THINGS WORK BEYOND PUSHBACK_SIZE
485485
writer.write("<da>\n");
486486
for (int i = 0; i < 10000; i++) {
487487
writer.write("<do/>\n");

0 commit comments

Comments
 (0)