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 9f00748  Fix Typos in JavaDoc, Comments and Tests (#201)
9f00748 is described below

commit 9f0074839bac413e75c943b2619d9a07b45bad1a
Author: Felix Rilling <[email protected]>
AuthorDate: Wed Feb 10 15:37:05 2021 +0100

    Fix Typos in JavaDoc, Comments and Tests (#201)
    
    * Fixed incorrect/missing JavaDoc.
    
    * Fixed misc. typos in comments and tests.
    
    * Fixed typos in exception messages.
---
 src/main/java/org/apache/commons/io/FileUtils.java                  | 6 +++---
 src/main/java/org/apache/commons/io/FilenameUtils.java              | 2 +-
 src/main/java/org/apache/commons/io/input/XmlStreamReader.java      | 2 +-
 .../org/apache/commons/io/output/AbstractByteArrayOutputStream.java | 2 +-
 src/main/java/org/apache/commons/io/output/WriterOutputStream.java  | 4 ++--
 src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java    | 2 +-
 .../org/apache/commons/io/FileUtilsDirectoryContainsTestCase.java   | 2 +-
 .../apache/commons/io/input/BufferedFileChannelInputStreamTest.java | 2 +-
 src/test/java/org/apache/commons/io/input/NullInputStreamTest.java  | 2 +-
 src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java  | 2 +-
 .../org/apache/commons/io/input/XmlStreamReaderUtilitiesTest.java   | 4 ++--
 .../commons/io/input/buffer/CircularBufferInputStreamTest.java      | 2 +-
 .../org/apache/commons/io/output/DeferredFileOutputStreamTest.java  | 2 +-
 13 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/FileUtils.java 
b/src/main/java/org/apache/commons/io/FileUtils.java
index d3ccf31..76d17f2 100644
--- a/src/main/java/org/apache/commons/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/io/FileUtils.java
@@ -2192,7 +2192,7 @@ public class FileUtils {
      * @throws IOException if the directory was not created along with all its 
parent directories.
      * @throws IOException if the given file object is not a directory.
      * @throws SecurityException See {@link File#mkdirs()}.
-     * @see @see File#mkdirs()
+     * @see File#mkdirs()
      */
     private static File mkdirs(final File directory) throws IOException {
         if (directory != null) {
@@ -2625,7 +2625,7 @@ public class FileUtils {
      * Requires that the given {@code File} is a directory.
      *
      * @param directory The {@code File} to check.
-     * @param name
+     * @param name The parameter name to use in the exception message in case 
of null input or if the file is not a directory.
      * @return the given directory.
      * @throws NullPointerException if the given {@code File} is {@code null}.
      * @throws IllegalArgumentException if the given {@code File} does not 
exist or is not a directory.
@@ -3052,7 +3052,7 @@ public class FileUtils {
      *
      * @param extensions an array of extensions. Format: {"java", "xml"}
      * @return an array of suffixes. Format: {".java", ".xml"}
-     * @throws NullPointerException
+     * @throws NullPointerException if the parameter is null
      */
     private static String[] toSuffixes(final String... extensions) {
         Objects.requireNonNull(extensions, "extensions");
diff --git a/src/main/java/org/apache/commons/io/FilenameUtils.java 
b/src/main/java/org/apache/commons/io/FilenameUtils.java
index bd57e4e..c14ad08 100644
--- a/src/main/java/org/apache/commons/io/FilenameUtils.java
+++ b/src/main/java/org/apache/commons/io/FilenameUtils.java
@@ -1430,7 +1430,7 @@ public class FilenameUtils {
                     } else {
                         // matching from current position
                         if (!caseSensitivity.checkRegionMatches(fileName, 
textIdx, wcs[wcsIdx])) {
-                            // couldnt match token
+                            // couldn't match token
                             break;
                         }
                     }
diff --git a/src/main/java/org/apache/commons/io/input/XmlStreamReader.java 
b/src/main/java/org/apache/commons/io/input/XmlStreamReader.java
index ab4c31f..28a2af1 100644
--- a/src/main/java/org/apache/commons/io/input/XmlStreamReader.java
+++ b/src/main/java/org/apache/commons/io/input/XmlStreamReader.java
@@ -512,7 +512,7 @@ public class XmlStreamReader extends Reader {
      *         the URLConnection.
      */
     public XmlStreamReader(final URLConnection conn, final String 
defaultEncoding) throws IOException {
-        Objects.requireNonNull(conn, "conm");
+        Objects.requireNonNull(conn, "conn");
         this.defaultEncoding = defaultEncoding;
         final boolean lenient = true;
         final String contentType = conn.getContentType();
diff --git 
a/src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java 
b/src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java
index e867a74..4fbdbae 100644
--- 
a/src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java
+++ 
b/src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java
@@ -301,7 +301,7 @@ public abstract class AbstractByteArrayOutputStream extends 
OutputStream {
      * @see #reset()
      * @since 2.7
      */
-    @SuppressWarnings("resource") // The result InputStream MUIST be managed 
by the call site.
+    @SuppressWarnings("resource") // The result InputStream MUST be managed by 
the call site.
     protected <T extends InputStream> InputStream toInputStream(
             final InputStreamConstructor<T> isConstructor) {
         int remaining = count;
diff --git a/src/main/java/org/apache/commons/io/output/WriterOutputStream.java 
b/src/main/java/org/apache/commons/io/output/WriterOutputStream.java
index a0a6476..1a30612 100644
--- a/src/main/java/org/apache/commons/io/output/WriterOutputStream.java
+++ b/src/main/java/org/apache/commons/io/output/WriterOutputStream.java
@@ -333,14 +333,14 @@ public class WriterOutputStream extends OutputStream {
             try {
                 charsetDecoder2.decode(bb2, cb2, i == (len - 1));
             } catch ( final IllegalArgumentException e){
-                throw new UnsupportedOperationException("UTF-16 requested when 
runninng on an IBM JDK with broken UTF-16 support. " +
+                throw new UnsupportedOperationException("UTF-16 requested when 
running on an IBM JDK with broken UTF-16 support. " +
                         "Please find a JDK that supports UTF-16 if you intend 
to use UF-16 with WriterOutputStream");
             }
             bb2.compact();
         }
         cb2.rewind();
         if (!TEST_STRING_2.equals(cb2.toString())){
-            throw new UnsupportedOperationException("UTF-16 requested when 
runninng on an IBM JDK with broken UTF-16 support. " +
+            throw new UnsupportedOperationException("UTF-16 requested when 
running on an IBM JDK with broken UTF-16 support. " +
                     "Please find a JDK that supports UTF-16 if you intend to 
use UF-16 with WriterOutputStream");
         }
 
diff --git a/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java 
b/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java
index 8516b30..e080326 100644
--- a/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java
@@ -72,7 +72,7 @@ public class FileSystemUtilsTestCase {
             final long kb = FileSystemUtils.freeSpaceKb("/");
             // Assume disk space does not fluctuate
             // more than 1% between the above two calls;
-            // this also also small enough to verifiy freeSpaceKb uses
+            // this also also small enough to verify freeSpaceKb uses
             // kibibytes (1024) instead of SI kilobytes (1000)
             final double acceptableDelta = kb * 0.01d;
             if (kilobyteBlock) {
diff --git 
a/src/test/java/org/apache/commons/io/FileUtilsDirectoryContainsTestCase.java 
b/src/test/java/org/apache/commons/io/FileUtilsDirectoryContainsTestCase.java
index 2466c74..6ac3f51 100644
--- 
a/src/test/java/org/apache/commons/io/FileUtilsDirectoryContainsTestCase.java
+++ 
b/src/test/java/org/apache/commons/io/FileUtilsDirectoryContainsTestCase.java
@@ -156,7 +156,7 @@ public class FileUtilsDirectoryContainsTestCase {
         final File file = new File(top, "DOESNOTEXIST");
         assertTrue(top.exists(), "Check directory exists");
         assertFalse(file.exists(), "Check file does not exist");
-        assertFalse(FileUtils.directoryContains(top, file), "Direcory does not 
contain unrealized file");
+        assertFalse(FileUtils.directoryContains(top, file), "Directory does 
not contain unrealized file");
     }
 
     @Test
diff --git 
a/src/test/java/org/apache/commons/io/input/BufferedFileChannelInputStreamTest.java
 
b/src/test/java/org/apache/commons/io/input/BufferedFileChannelInputStreamTest.java
index 2580abe..90ab736 100644
--- 
a/src/test/java/org/apache/commons/io/input/BufferedFileChannelInputStreamTest.java
+++ 
b/src/test/java/org/apache/commons/io/input/BufferedFileChannelInputStreamTest.java
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.BeforeEach;
 /**
  * Tests functionality of {@link BufferedFileChannelInputStream}.
  *
- * This class was ported and adapted from Apache Spark commit 
933dc6cb7b3de1d8ccaf73d124d6eb95b947ed19 wher it was
+ * This class was ported and adapted from Apache Spark commit 
933dc6cb7b3de1d8ccaf73d124d6eb95b947ed19 where it was
  * called {@code BufferedFileChannelInputStreamSuite}.
  */
 public class BufferedFileChannelInputStreamTest extends 
AbstractInputStreamTest {
diff --git a/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java 
b/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java
index 4ad1d35..7fff629 100644
--- a/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java
@@ -46,7 +46,7 @@ public class NullInputStreamTest {
         }
         assertEquals(0, input.available(), "Available after contents all 
read");
 
-        // Check availabale is zero after End of file
+        // Check available is zero after End of file
         assertEquals(-1, input.read(), "End of File");
         assertEquals(0, input.available(), "Available after End of File");
 
diff --git a/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java 
b/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java
index 9a40762..369565f 100644
--- a/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java
+++ b/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java
@@ -481,7 +481,7 @@ public class XmlStreamReaderTest {
         final String xmlDoc = getXML(bomType, xmlType, streamEnc, prologEnc);
         writer.write(xmlDoc);
 
-        // PADDDING TO TEST THINGS WORK BEYOND PUSHBACK_SIZE
+        // PADDING TO TEST THINGS WORK BEYOND PUSHBACK_SIZE
         writer.write("<da>\n");
         for (int i = 0; i < 10000; i++) {
             writer.write("<do/>\n");
diff --git 
a/src/test/java/org/apache/commons/io/input/XmlStreamReaderUtilitiesTest.java 
b/src/test/java/org/apache/commons/io/input/XmlStreamReaderUtilitiesTest.java
index 54700f6..8c6de90 100644
--- 
a/src/test/java/org/apache/commons/io/input/XmlStreamReaderUtilitiesTest.java
+++ 
b/src/test/java/org/apache/commons/io/input/XmlStreamReaderUtilitiesTest.java
@@ -171,7 +171,7 @@ public class XmlStreamReaderUtilitiesTest {
     }
 
     @Test
-    public void testCalculateRawEncodingAdditonalUTF16() throws IOException {
+    public void testCalculateRawEncodingAdditionalUTF16() throws IOException {
         //                           BOM         Guess       XML         
Default
         checkRawError(RAWMGS1,       "UTF-16BE", "UTF-16",   null,       null);
         checkRawEncoding("UTF-16BE", "UTF-16BE", null,       "UTF-16",   null);
@@ -186,7 +186,7 @@ public class XmlStreamReaderUtilitiesTest {
     }
 
     @Test
-    public void testCalculateRawEncodingAdditonalUTF32() throws IOException {
+    public void testCalculateRawEncodingAdditionalUTF32() throws IOException {
         //                           BOM         Guess       XML         
Default
         checkRawError(RAWMGS1,       "UTF-32BE", "UTF-32",   null,       null);
         checkRawEncoding("UTF-32BE", "UTF-32BE", null,       "UTF-32",   null);
diff --git 
a/src/test/java/org/apache/commons/io/input/buffer/CircularBufferInputStreamTest.java
 
b/src/test/java/org/apache/commons/io/input/buffer/CircularBufferInputStreamTest.java
index e8f118f..a5000ce 100644
--- 
a/src/test/java/org/apache/commons/io/input/buffer/CircularBufferInputStreamTest.java
+++ 
b/src/test/java/org/apache/commons/io/input/buffer/CircularBufferInputStreamTest.java
@@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test;
 
 public class CircularBufferInputStreamTest {
        private final Random rnd = new Random(1530960934483L); // 
System.currentTimeMillis(), when this test was written.
-                                                              // Always using 
the same seed should ensure a reproducable test.
+                                                              // Always using 
the same seed should ensure a reproducible test.
 
        @Test
        public void testRandomRead() throws Exception {
diff --git 
a/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java 
b/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java
index 683fa30..f5200c1 100644
--- 
a/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java
+++ 
b/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java
@@ -215,7 +215,7 @@ public class DeferredFileOutputStreamTest {
 
             try {
                 dfos.writeTo(baos);
-                fail("Should not have been able to write before closeing");
+                fail("Should not have been able to write before closing");
             } catch (final IOException ioe) {
                 // ok, as expected
             }

Reply via email to