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-text.git


The following commit(s) were added to refs/heads/master by this push:
     new 2559593  [TEXT-182] Fix typos (#137)
2559593 is described below

commit 2559593ad0cf37b43a6f4631c747d9b67dae8d5f
Author: XenoAmess <xenoam...@gmail.com>
AuthorDate: Tue Jul 21 20:21:22 2020 +0800

    [TEXT-182] Fix typos (#137)
    
    * fix typos
    
    * fix travis-ci error for line length.(after typo fix some lines get 
longer, 120->121 thus fails.)
---
 src/main/java/org/apache/commons/text/CaseUtils.java         |  2 +-
 .../java/org/apache/commons/text/ExtendedMessageFormat.java  |  4 ++--
 src/main/java/org/apache/commons/text/StrSubstitutor.java    |  8 ++++----
 src/main/java/org/apache/commons/text/StringSubstitutor.java | 12 ++++++------
 .../org/apache/commons/text/io/StringSubstitutorReader.java  |  2 +-
 .../org/apache/commons/text/lookup/ConstantStringLookup.java |  4 ++--
 .../org/apache/commons/text/lookup/DateStringLookup.java     |  2 +-
 .../commons/text/lookup/IllegalArgumentExceptions.java       | 10 ++++++----
 .../org/apache/commons/text/lookup/StringLookupFactory.java  |  2 +-
 .../java/org/apache/commons/text/AlphabetConverterTest.java  |  2 +-
 .../org/apache/commons/text/ExtendedMessageFormatTest.java   |  6 +++---
 src/test/java/org/apache/commons/text/StrLookupTest.java     |  2 +-
 .../java/org/apache/commons/text/StringSubstitutorTest.java  |  4 ++--
 .../java/org/apache/commons/text/TextStringBuilderTest.java  |  2 +-
 .../org/apache/commons/text/diff/ReplacementsFinderTest.java |  2 +-
 .../similarity/LongestCommonSubsequenceDistanceTest.java     |  2 +-
 .../org/apache/commons/text/translate/EntityArraysTest.java  |  2 +-
 17 files changed, 35 insertions(+), 33 deletions(-)

diff --git a/src/main/java/org/apache/commons/text/CaseUtils.java 
b/src/main/java/org/apache/commons/text/CaseUtils.java
index 641f64c..cbdae7e 100644
--- a/src/main/java/org/apache/commons/text/CaseUtils.java
+++ b/src/main/java/org/apache/commons/text/CaseUtils.java
@@ -47,7 +47,7 @@ public class CaseUtils {
 
     /**
      * <p>Converts all the delimiter separated words in a String into 
camelCase,
-     * that is each word is made up of a titlecase character and then a series 
of
+     * that is each word is made up of a title case character and then a 
series of
      * lowercase characters.</p>
      *
      * <p>The delimiters represent a set of characters understood to separate 
words.
diff --git a/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java 
b/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java
index e4b5b6a..28c1604 100644
--- a/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java
+++ b/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java
@@ -89,12 +89,12 @@ public class ExtendedMessageFormat extends MessageFormat {
     private static final char START_FMT = ',';
 
     /**
-     * A right side squigly brace.
+     * A right side squiggly brace.
      */
     private static final char END_FE = '}';
 
     /**
-     * A left side squigly brace.
+     * A left side squiggly brace.
      */
     private static final char START_FE = '{';
 
diff --git a/src/main/java/org/apache/commons/text/StrSubstitutor.java 
b/src/main/java/org/apache/commons/text/StrSubstitutor.java
index 5216a07..362c023 100644
--- a/src/main/java/org/apache/commons/text/StrSubstitutor.java
+++ b/src/main/java/org/apache/commons/text/StrSubstitutor.java
@@ -1103,7 +1103,7 @@ public class StrSubstitutor {
     /**
      * Gets the variable default value delimiter matcher currently in use.
      * <p>
-     * The variable default value delimiter is the character or characters 
that delimite the
+     * The variable default value delimiter is the character or characters 
that delimit the
      * variable name and the variable default value. This delimiter is 
expressed in terms of a matcher
      * allowing advanced variable default value delimiter matches.
      * <p>
@@ -1118,7 +1118,7 @@ public class StrSubstitutor {
     /**
      * Sets the variable default value delimiter matcher to use.
      * <p>
-     * The variable default value delimiter is the character or characters 
that delimite the
+     * The variable default value delimiter is the character or characters 
that delimit the
      * variable name and the variable default value. This delimiter is 
expressed in terms of a matcher
      * allowing advanced variable default value delimiter matches.
      * <p>
@@ -1136,7 +1136,7 @@ public class StrSubstitutor {
     /**
      * Sets the variable default value delimiter to use.
      * <p>
-     * The variable default value delimiter is the character or characters 
that delimite the
+     * The variable default value delimiter is the character or characters 
that delimit the
      * variable name and the variable default value. This method allows a 
single character
      * variable default value delimiter to be easily set.
      *
@@ -1150,7 +1150,7 @@ public class StrSubstitutor {
     /**
      * Sets the variable default value delimiter to use.
      * <p>
-     * The variable default value delimiter is the character or characters 
that delimite the
+     * The variable default value delimiter is the character or characters 
that delimit the
      * variable name and the variable default value. This method allows a 
string
      * variable default value delimiter to be easily set.
      * <p>
diff --git a/src/main/java/org/apache/commons/text/StringSubstitutor.java 
b/src/main/java/org/apache/commons/text/StringSubstitutor.java
index 0400c43..098d7bb 100644
--- a/src/main/java/org/apache/commons/text/StringSubstitutor.java
+++ b/src/main/java/org/apache/commons/text/StringSubstitutor.java
@@ -614,7 +614,7 @@ public class StringSubstitutor {
     /**
      * Gets the variable default value delimiter matcher currently in use.
      * <p>
-     * The variable default value delimiter is the character or characters 
that delimite the variable name and the
+     * The variable default value delimiter is the character or characters 
that delimit the variable name and the
      * variable default value. This delimiter is expressed in terms of a 
matcher allowing advanced variable default
      * value delimiter matches.
      * </p>
@@ -1131,7 +1131,7 @@ public class StringSubstitutor {
     /**
      * Sets the variable default value delimiter to use.
      * <p>
-     * The variable default value delimiter is the character or characters 
that delimite the variable name and the
+     * The variable default value delimiter is the character or characters 
that delimit the variable name and the
      * variable default value. This method allows a single character variable 
default value delimiter to be easily set.
      * </p>
      *
@@ -1145,7 +1145,7 @@ public class StringSubstitutor {
     /**
      * Sets the variable default value delimiter to use.
      * <p>
-     * The variable default value delimiter is the character or characters 
that delimite the variable name and the
+     * The variable default value delimiter is the character or characters 
that delimit the variable name and the
      * variable default value. This method allows a string variable default 
value delimiter to be easily set.
      * </p>
      * <p>
@@ -1167,7 +1167,7 @@ public class StringSubstitutor {
     /**
      * Sets the variable default value delimiter matcher to use.
      * <p>
-     * The variable default value delimiter is the character or characters 
that delimite the variable name and the
+     * The variable default value delimiter is the character or characters 
that delimit the variable name and the
      * variable default value. This delimiter is expressed in terms of a 
matcher allowing advanced variable default
      * value delimiter matches.
      * </p>
@@ -1337,7 +1337,7 @@ public class StringSubstitutor {
         int bufEnd = offset + length;
         int pos = offset;
         int escPos = -1;
-        outter: while (pos < bufEnd) {
+        outer: while (pos < bufEnd) {
             final int startMatchLen = prefixMatcher.isMatch(builder, pos, 
offset, bufEnd);
             if (startMatchLen == 0) {
                 pos++;
@@ -1382,7 +1382,7 @@ public class StringSubstitutor {
                                 bufEnd--;
                                 pos = startPos + 1;
                                 startPos--;
-                                continue outter;
+                                continue outer;
                             }
                             // get var name
                             String varNameExpr = builder.toString(startPos + 
startMatchLen,
diff --git 
a/src/main/java/org/apache/commons/text/io/StringSubstitutorReader.java 
b/src/main/java/org/apache/commons/text/io/StringSubstitutorReader.java
index 35307d5..fbe151b 100644
--- a/src/main/java/org/apache/commons/text/io/StringSubstitutorReader.java
+++ b/src/main/java/org/apache/commons/text/io/StringSubstitutorReader.java
@@ -88,7 +88,7 @@ public class StringSubstitutorReader extends FilterReader {
     }
 
     /**
-     * Reads a requested number of chars from the underlying reader into the 
buffer. On EOS, set the state is DRANING,
+     * Reads a requested number of chars from the underlying reader into the 
buffer. On EOS, set the state is DRAINING,
      * drain, and return a drain count, otherwise, returns the actual read 
count.
      */
     private int bufferOrDrainOnEos(final int requestReadCount, final char[] 
target, final int targetIndex,
diff --git 
a/src/main/java/org/apache/commons/text/lookup/ConstantStringLookup.java 
b/src/main/java/org/apache/commons/text/lookup/ConstantStringLookup.java
index 66f8298..a7a5d61 100644
--- a/src/main/java/org/apache/commons/text/lookup/ConstantStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/ConstantStringLookup.java
@@ -67,7 +67,7 @@ class ConstantStringLookup extends AbstractStringLookup {
     private static final ConcurrentHashMap<String, String> CONSTANT_CACHE = 
new ConcurrentHashMap<>();
 
     /** Constant for the field separator. */
-    private static final char FIELD_SEPRATOR = '.';
+    private static final char FIELD_SEPARATOR = '.';
 
     /**
      * Defines the singleton for this class.
@@ -114,7 +114,7 @@ class ConstantStringLookup extends AbstractStringLookup {
         if (result != null) {
             return result;
         }
-        final int fieldPos = key.lastIndexOf(FIELD_SEPRATOR);
+        final int fieldPos = key.lastIndexOf(FIELD_SEPARATOR);
         if (fieldPos < 0) {
             return null;
         }
diff --git a/src/main/java/org/apache/commons/text/lookup/DateStringLookup.java 
b/src/main/java/org/apache/commons/text/lookup/DateStringLookup.java
index e7e192e..b3bcb9c 100644
--- a/src/main/java/org/apache/commons/text/lookup/DateStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/DateStringLookup.java
@@ -41,7 +41,7 @@ import org.apache.commons.text.StringSubstitutor;
  * StringSubstitutor.createInterpolator().replace("... ${date:yyyy-MM-dd} 
..."));
  * </pre>
  * <p>
- * The above examples convert {@code "yyyy-MM-dd"} to todays's date, for 
example, {@code "2019-08-04"}.
+ * The above examples convert {@code "yyyy-MM-dd"} to today's date, for 
example, {@code "2019-08-04"}.
  * </p>
  */
 final class DateStringLookup extends AbstractStringLookup {
diff --git 
a/src/main/java/org/apache/commons/text/lookup/IllegalArgumentExceptions.java 
b/src/main/java/org/apache/commons/text/lookup/IllegalArgumentExceptions.java
index 6ebb0e3..50b3926 100644
--- 
a/src/main/java/org/apache/commons/text/lookup/IllegalArgumentExceptions.java
+++ 
b/src/main/java/org/apache/commons/text/lookup/IllegalArgumentExceptions.java
@@ -25,23 +25,25 @@ package org.apache.commons.text.lookup;
 final class IllegalArgumentExceptions {
 
     /**
-     * Creates an {@link IllegalArgumentException} with a message formated 
with {@link String#format(String,Object...)}.
+     * Creates an {@link IllegalArgumentException} with a message
+     * formatted with {@link String#format(String,Object...)}.
      *
      * @param format See {@link String#format(String,Object...)}
      * @param args See {@link String#format(String,Object...)}
-     * @return an {@link IllegalArgumentException} with a message formated 
with {@link String#format(String,Object...)}
+     * @return an {@link IllegalArgumentException} with a message formatted 
with {@link String#format(String,Object...)}
      */
     static IllegalArgumentException format(final String format, final 
Object... args) {
         return new IllegalArgumentException(String.format(format, args));
     }
 
     /**
-     * Creates an {@link IllegalArgumentException} with a message formated 
with {@link String#format(String,Object...)}.
+     * Creates an {@link IllegalArgumentException} with a message
+     * formatted with {@link String#format(String,Object...)}.
      *
      * @param t the throwable cause
      * @param format See {@link String#format(String,Object...)}
      * @param args See {@link String#format(String,Object...)}
-     * @return an {@link IllegalArgumentException} with a message formated 
with {@link String#format(String,Object...)}
+     * @return an {@link IllegalArgumentException} with a message formatted 
with {@link String#format(String,Object...)}
      */
     static IllegalArgumentException format(final Throwable t, final String 
format, final Object... args) {
         return new IllegalArgumentException(String.format(format, args), t);
diff --git 
a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java 
b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
index 59db15f..b38dd41 100644
--- a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
+++ b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
@@ -503,7 +503,7 @@ public final class StringLookupFactory {
      * lookup key.
      *
      * @param <R> the function return type.
-     * @param <U> the funtion's second paremeter type.
+     * @param <U> the function's second parameter type.
      * @param biFunction the function.
      * @return a new MapStringLookup.
      * @since 1.9
diff --git a/src/test/java/org/apache/commons/text/AlphabetConverterTest.java 
b/src/test/java/org/apache/commons/text/AlphabetConverterTest.java
index 28983f2..34c194a 100644
--- a/src/test/java/org/apache/commons/text/AlphabetConverterTest.java
+++ b/src/test/java/org/apache/commons/text/AlphabetConverterTest.java
@@ -276,7 +276,7 @@ public class AlphabetConverterTest {
     }
 
     @Test
-    public void unexpectedEndwhileDecodingTest() {
+    public void unexpectedEndWhileDecodingTest() {
         final String toDecode = "00d01d0";
         assertThatThrownBy(() -> {
             final AlphabetConverter ac = createJavadocExample();
diff --git 
a/src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java 
b/src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java
index bea150f..9815f5e 100644
--- a/src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java
+++ b/src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java
@@ -130,7 +130,7 @@ public class ExtendedMessageFormatTest {
 
     /**
      * Create an ExtendedMessageFormat for the specified pattern and locale 
and check the
-     * formated output matches the expected result for the parameters.
+     * formatted output matches the expected result for the parameters.
      * @param pattern string
      * @param registryUnused map (currently unused)
      * @param args Object[]
@@ -356,7 +356,7 @@ public class ExtendedMessageFormatTest {
     public void testEqualsHashcode() {
         final Map<String, ? extends FormatFactory> fmtRegistry =
                 Collections.singletonMap("testfmt", new 
LowerCaseFormatFactory());
-        final Map<String, ? extends FormatFactory> otherRegitry =
+        final Map<String, ? extends FormatFactory> otherRegistry =
                 Collections.singletonMap("testfmt", new 
UpperCaseFormatFactory());
 
         final String pattern = "Pattern: {0,testfmt}";
@@ -386,7 +386,7 @@ public class ExtendedMessageFormatTest {
         assertFalse(emf.hashCode() == other.hashCode(), "pattern, hashcode()");
 
         // Different registry
-        other = new ExtendedMessageFormat(pattern, Locale.US, otherRegitry);
+        other = new ExtendedMessageFormat(pattern, Locale.US, otherRegistry);
         assertFalse(emf.equals(other), "registry, equals()");
         assertFalse(emf.hashCode() == other.hashCode(), "registry, 
hashcode()");
 
diff --git a/src/test/java/org/apache/commons/text/StrLookupTest.java 
b/src/test/java/org/apache/commons/text/StrLookupTest.java
index c665378..f62a63f 100644
--- a/src/test/java/org/apache/commons/text/StrLookupTest.java
+++ b/src/test/java/org/apache/commons/text/StrLookupTest.java
@@ -82,7 +82,7 @@ public class StrLookupTest  {
     }
 
     @Test
-    public void testSystemProperiesLookup() {
+    public void testSystemPropertiesLookup() {
         assertEquals(System.getProperty("os.name"), 
StrLookup.systemPropertiesLookup().lookup("os.name"));
         assertNull(StrLookup.systemPropertiesLookup().lookup(""));
         assertNull(StrLookup.systemPropertiesLookup().lookup("other"));
diff --git a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java 
b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
index b4a7446..3c23b23 100644
--- a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
+++ b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
@@ -254,7 +254,7 @@ public class StringSubstitutorTest {
      * Tests interpolation with weird boundary patterns.
      */
     @Test
-    public void testReplace_JiraText178_WeirdPattenrs2() throws IOException {
+    public void testReplace_JiraText178_WeirdPatterns2() throws IOException {
         doReplace("${1}", "$${${a}}", false);
     }
 
@@ -263,7 +263,7 @@ public class StringSubstitutorTest {
      */
     @Test
     @Disabled
-    public void testReplace_JiraText178_WeirdPattenrs3() throws IOException {
+    public void testReplace_JiraText178_WeirdPatterns3() throws IOException {
         doReplace("${${a}", "$${${a}", false); // not "$${1" or "${1"
     }
 
diff --git a/src/test/java/org/apache/commons/text/TextStringBuilderTest.java 
b/src/test/java/org/apache/commons/text/TextStringBuilderTest.java
index 0936b50..3f1eff1 100644
--- a/src/test/java/org/apache/commons/text/TextStringBuilderTest.java
+++ b/src/test/java/org/apache/commons/text/TextStringBuilderTest.java
@@ -203,7 +203,7 @@ public class TextStringBuilderTest {
         final StringWriter writer = new StringWriter();
         writer.append("Test");
 
-        // TODO Use Commons IO NullApendable.INSTANCE
+        // TODO Use Commons IO NullAppendable.INSTANCE
         sb.appendTo(new Appendable() {
 
             @Override
diff --git 
a/src/test/java/org/apache/commons/text/diff/ReplacementsFinderTest.java 
b/src/test/java/org/apache/commons/text/diff/ReplacementsFinderTest.java
index a93b40c..70843c2 100644
--- a/src/test/java/org/apache/commons/text/diff/ReplacementsFinderTest.java
+++ b/src/test/java/org/apache/commons/text/diff/ReplacementsFinderTest.java
@@ -69,7 +69,7 @@ public class ReplacementsFinderTest {
         assertArrayEquals(to, handler.getTo().toArray(new Character[0]), "To 
characters do not match");
     }
 
-    // Helper RecplacementsHandler implementation for testing
+    // Helper ReplacementsHandler implementation for testing
     private class SimpleHandler implements ReplacementsHandler<Character> {
         private int skipped;
         private final List<Character> from;
diff --git 
a/src/test/java/org/apache/commons/text/similarity/LongestCommonSubsequenceDistanceTest.java
 
b/src/test/java/org/apache/commons/text/similarity/LongestCommonSubsequenceDistanceTest.java
index 257b4fc..0c53a93 100644
--- 
a/src/test/java/org/apache/commons/text/similarity/LongestCommonSubsequenceDistanceTest.java
+++ 
b/src/test/java/org/apache/commons/text/similarity/LongestCommonSubsequenceDistanceTest.java
@@ -35,7 +35,7 @@ public class LongestCommonSubsequenceDistanceTest {
     }
 
     @Test
-    public void testGettingLogestCommonSubsequenceDistacne() {
+    public void testGettingLongestCommonSubsequenceDistance() {
         assertThat(subject.apply("", "")).isEqualTo(0);
         assertThat(subject.apply("left", "")).isEqualTo(4);
         assertThat(subject.apply("", "right")).isEqualTo(5);
diff --git 
a/src/test/java/org/apache/commons/text/translate/EntityArraysTest.java 
b/src/test/java/org/apache/commons/text/translate/EntityArraysTest.java
index 78d1d21..3361e8e 100644
--- a/src/test/java/org/apache/commons/text/translate/EntityArraysTest.java
+++ b/src/test/java/org/apache/commons/text/translate/EntityArraysTest.java
@@ -114,7 +114,7 @@ public class EntityArraysTest  {
     }
 
     @Test
-    public void testJavaCntrlCharsMap() {
+    public void testJavaCtrlCharsMap() {
         testEscapeVsUnescapeMaps(EntityArrays.JAVA_CTRL_CHARS_ESCAPE, 
EntityArrays.JAVA_CTRL_CHARS_UNESCAPE);
     }
 

Reply via email to