From d7889a8ffea465a223dad8410f5d36e48641aa69 Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Fri, 15 Jul 2022 14:25:29 +0200 Subject: [PATCH 1/2] (doc) Fix typos in javadoc and comments (#920) --- .../org/apache/commons/lang3/ArrayUtils.java | 68 +++++++------- .../apache/commons/lang3/BooleanUtils.java | 14 +-- .../commons/lang3/CharSequenceUtils.java | 2 +- .../org/apache/commons/lang3/EnumUtils.java | 6 +- .../org/apache/commons/lang3/Functions.java | 6 +- .../org/apache/commons/lang3/LocaleUtils.java | 2 +- .../java/org/apache/commons/lang3/Range.java | 4 +- .../org/apache/commons/lang3/StringUtils.java | 54 +++++------ .../apache/commons/lang3/arch/Processor.java | 2 +- .../lang3/builder/CompareToBuilder.java | 2 +- .../commons/lang3/builder/DiffBuilder.java | 72 +++++++-------- .../commons/lang3/builder/DiffResult.java | 4 +- .../commons/lang3/builder/EqualsBuilder.java | 90 +++++++++---------- .../lang3/builder/HashCodeBuilder.java | 2 +- .../lang3/builder/RecursiveToStringStyle.java | 2 +- .../lang3/compare/ComparableUtils.java | 4 +- .../lang3/concurrent/TimedSemaphore.java | 4 +- .../lang3/event/EventListenerSupport.java | 2 +- .../commons/lang3/function/Failable.java | 6 +- .../lang3/function/FailableFunction.java | 2 +- .../apache/commons/lang3/math/Fraction.java | 2 +- .../commons/lang3/math/NumberUtils.java | 6 +- .../commons/lang3/mutable/MutableInt.java | 2 +- .../commons/lang3/reflect/MemberUtils.java | 2 +- .../commons/lang3/reflect/MethodUtils.java | 4 +- .../commons/lang3/reflect/TypeUtils.java | 2 +- .../apache/commons/lang3/text/StrBuilder.java | 8 +- .../commons/lang3/text/StrSubstitutor.java | 2 +- .../commons/lang3/text/StrTokenizer.java | 2 +- .../lang3/time/DurationFormatUtils.java | 10 +-- .../commons/lang3/time/FastDateFormat.java | 2 +- .../commons/lang3/time/FastDateParser.java | 2 +- .../commons/lang3/time/FastDatePrinter.java | 6 +- .../commons/lang3/time/FormatCache.java | 2 +- .../apache/commons/lang3/ObjectUtilsTest.java | 2 +- .../lang3/StringUtilsSubstringTest.java | 2 +- .../apache/commons/lang3/StringUtilsTest.java | 4 +- .../lang3/builder/EqualsBuilderTest.java | 2 +- .../HashCodeBuilderAndEqualsBuilderTest.java | 2 +- .../lang3/exception/ExceptionUtilsTest.java | 4 +- .../commons/lang3/function/Objects.java | 4 +- .../commons/lang3/math/NumberUtilsTest.java | 48 +++++----- .../lang3/text/ExtendedMessageFormatTest.java | 10 +-- .../commons/lang3/time/DateUtilsTest.java | 2 +- .../lang3/time/FastDateParserTest.java | 6 +- 45 files changed, 243 insertions(+), 243 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/ArrayUtils.java b/src/main/java/org/apache/commons/lang3/ArrayUtils.java index f0a698f3c..ca86aabd3 100644 --- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java +++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java @@ -1338,7 +1338,7 @@ public class ArrayUtils { /** * Copies the given array and adds the given element at the beginning of the new array. *

- * The new array contains the same elements of the input array plus the given element in the first positioaddFirstaddFirstaddFirstn. The + * The new array contains the same elements of the input array plus the given element in the first position. The * component type of the new array is the same as that of the input array. *

*

@@ -1770,7 +1770,7 @@ public class ArrayUtils { } /** - * Get a hash code for an array handling multi-dimensional arrays correctly. + * Get a hash code for an array handling multidimensional arrays correctly. *

* Multi-dimensional primitive arrays are also handled correctly by this method. *

@@ -1790,7 +1790,7 @@ public class ArrayUtils { * * @param array the array to search through for the object, may be {@code null} * @param valueToFind the value to find - * @return a BitSet of all the the indices of the value within the array, + * @return a BitSet of all the indices of the value within the array, * an empty BitSet if not found or {@code null} array input * @since 3.10 */ @@ -3306,8 +3306,8 @@ public class ArrayUtils { * Multi-dimensional primitive arrays are also handled correctly by this method. *

* - * @param array1 the left hand array to compare, may be {@code null} - * @param array2 the right hand array to compare, may be {@code null} + * @param array1 the left-hand array to compare, may be {@code null} + * @param array2 the right-hand array to compare, may be {@code null} * @return {@code true} if the arrays are equal * @deprecated this method has been replaced by {@code java.util.Objects.deepEquals(Object, Object)} and will be * removed from future releases. @@ -3557,7 +3557,7 @@ public class ArrayUtils { /** * Checks whether two arrays are the same type taking into account - * multi-dimensional arrays. + * multidimensional arrays. * * @param array1 the first array, must not be {@code null} * @param array2 the second array, must not be {@code null} @@ -5490,7 +5490,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified boolean array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5510,7 +5510,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified byte array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5530,7 +5530,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified char array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5550,7 +5550,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified double array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5570,7 +5570,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified float array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5590,7 +5590,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified int array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5610,7 +5610,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified long array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5630,7 +5630,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified short array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5650,7 +5650,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5671,7 +5671,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified boolean array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5689,7 +5689,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified byte array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5707,7 +5707,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified char array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5725,7 +5725,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified double array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5743,7 +5743,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified float array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5761,7 +5761,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified int array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5779,7 +5779,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified long array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5797,7 +5797,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified short array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5815,7 +5815,7 @@ public class ArrayUtils { * Removes the occurrences of the specified element from the specified array. *

* All subsequent elements are shifted to the left (subtracts one from their indices). - * If the array doesn't contains such an element, no elements are removed from the array. + * If the array doesn't contain such an element, no elements are removed from the array. * {@code null} will be returned if the input array is {@code null}. *

* @@ -5833,7 +5833,7 @@ public class ArrayUtils { /** * Removes the first occurrence of the specified element from the * specified array. All subsequent elements are shifted to the left - * (subtracts one from their indices). If the array doesn't contains + * (subtracts one from their indices). If the array doesn't contain * such an element, no elements are removed from the array. *

* This method returns a new array with the same elements of the input @@ -5866,7 +5866,7 @@ public class ArrayUtils { /** * Removes the first occurrence of the specified element from the * specified array. All subsequent elements are shifted to the left - * (subtracts one from their indices). If the array doesn't contains + * (subtracts one from their indices). If the array doesn't contain * such an element, no elements are removed from the array. *

* This method returns a new array with the same elements of the input @@ -5899,7 +5899,7 @@ public class ArrayUtils { /** * Removes the first occurrence of the specified element from the * specified array. All subsequent elements are shifted to the left - * (subtracts one from their indices). If the array doesn't contains + * (subtracts one from their indices). If the array doesn't contain * such an element, no elements are removed from the array. *

* This method returns a new array with the same elements of the input @@ -5932,7 +5932,7 @@ public class ArrayUtils { /** * Removes the first occurrence of the specified element from the * specified array. All subsequent elements are shifted to the left - * (subtracts one from their indices). If the array doesn't contains + * (subtracts one from their indices). If the array doesn't contain * such an element, no elements are removed from the array. *

* This method returns a new array with the same elements of the input @@ -5965,7 +5965,7 @@ public class ArrayUtils { /** * Removes the first occurrence of the specified element from the * specified array. All subsequent elements are shifted to the left - * (subtracts one from their indices). If the array doesn't contains + * (subtracts one from their indices). If the array doesn't contain * such an element, no elements are removed from the array. *

* This method returns a new array with the same elements of the input @@ -5998,7 +5998,7 @@ public class ArrayUtils { /** * Removes the first occurrence of the specified element from the * specified array. All subsequent elements are shifted to the left - * (subtracts one from their indices). If the array doesn't contains + * (subtracts one from their indices). If the array doesn't contain * such an element, no elements are removed from the array. *

* This method returns a new array with the same elements of the input @@ -6031,7 +6031,7 @@ public class ArrayUtils { /** * Removes the first occurrence of the specified element from the * specified array. All subsequent elements are shifted to the left - * (subtracts one from their indices). If the array doesn't contains + * (subtracts one from their indices). If the array doesn't contain * such an element, no elements are removed from the array. *

* This method returns a new array with the same elements of the input @@ -6064,7 +6064,7 @@ public class ArrayUtils { /** * Removes the first occurrence of the specified element from the * specified array. All subsequent elements are shifted to the left - * (subtracts one from their indices). If the array doesn't contains + * (subtracts one from their indices). If the array doesn't contain * such an element, no elements are removed from the array. *

* This method returns a new array with the same elements of the input @@ -6097,7 +6097,7 @@ public class ArrayUtils { /** * Removes the first occurrence of the specified element from the * specified array. All subsequent elements are shifted to the left - * (subtracts one from their indices). If the array doesn't contains + * (subtracts one from their indices). If the array doesn't contain * such an element, no elements are removed from the array. *

* This method returns a new array with the same elements of the input @@ -9083,7 +9083,7 @@ public class ArrayUtils { * an Array containing at least two elements, may be {@code null} * @return a {@link Map} that was created from the array * @throws IllegalArgumentException if one element of this Array is - * itself an Array containing less then two elements + * itself an Array containing less than two elements * @throws IllegalArgumentException if the array contains elements other * than {@link java.util.Map.Entry} and an Array */ diff --git a/src/main/java/org/apache/commons/lang3/BooleanUtils.java b/src/main/java/org/apache/commons/lang3/BooleanUtils.java index bdf967c5d..2998ab71e 100644 --- a/src/main/java/org/apache/commons/lang3/BooleanUtils.java +++ b/src/main/java/org/apache/commons/lang3/BooleanUtils.java @@ -501,8 +501,8 @@ public class BooleanUtils { * * * @param str the String to check - * @param trueString the String to match for {@code true} (case sensitive), may be {@code null} - * @param falseString the String to match for {@code false} (case sensitive), may be {@code null} + * @param trueString the String to match for {@code true} (case-sensitive), may be {@code null} + * @param falseString the String to match for {@code false} (case-sensitive), may be {@code null} * @return the boolean value of the string * @throws IllegalArgumentException if the String doesn't match */ @@ -586,7 +586,7 @@ public class BooleanUtils { * @param value the Integer to convert * @param trueValue the value to match for {@code true} * @param falseValue the value to match for {@code false} - * @param nullValue the value to to match for {@code null} + * @param nullValue the value to match for {@code null} * @return Boolean.TRUE, Boolean.FALSE, or {@code null} * @throws IllegalArgumentException if no match */ @@ -650,7 +650,7 @@ public class BooleanUtils { * @param value the Integer to convert * @param trueValue the value to match for {@code true}, may be {@code null} * @param falseValue the value to match for {@code false}, may be {@code null} - * @param nullValue the value to to match for {@code null}, may be {@code null} + * @param nullValue the value to match for {@code null}, may be {@code null} * @return Boolean.TRUE, Boolean.FALSE, or {@code null} * @throws IllegalArgumentException if no match */ @@ -823,9 +823,9 @@ public class BooleanUtils { * * * @param str the String to check - * @param trueString the String to match for {@code true} (case sensitive), may be {@code null} - * @param falseString the String to match for {@code false} (case sensitive), may be {@code null} - * @param nullString the String to match for {@code null} (case sensitive), may be {@code null} + * @param trueString the String to match for {@code true} (case-sensitive), may be {@code null} + * @param falseString the String to match for {@code false} (case-sensitive), may be {@code null} + * @param nullString the String to match for {@code null} (case-sensitive), may be {@code null} * @return the Boolean value of the string, {@code null} if either the String matches {@code nullString} * or if {@code null} input and {@code nullString} is {@code null} * @throws IllegalArgumentException if the String doesn't match diff --git a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java index 7f7acfc89..76a73f2f0 100644 --- a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java +++ b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java @@ -284,7 +284,7 @@ public class CharSequenceUtils { * Green implementation of regionMatches. * * @param cs the {@link CharSequence} to be processed - * @param ignoreCase whether or not to be case insensitive + * @param ignoreCase whether or not to be case-insensitive * @param thisStart the index to start on the {@code cs} CharSequence * @param substring the {@link CharSequence} to be looked for * @param start the index to start on the {@code substring} CharSequence diff --git a/src/main/java/org/apache/commons/lang3/EnumUtils.java b/src/main/java/org/apache/commons/lang3/EnumUtils.java index 2b3d030af..77320dc13 100644 --- a/src/main/java/org/apache/commons/lang3/EnumUtils.java +++ b/src/main/java/org/apache/commons/lang3/EnumUtils.java @@ -136,7 +136,7 @@ public class EnumUtils { * @param values the values we want to convert, not {@code null}, neither containing {@code null} * @param the type of the enumeration * @return a long[] whose values provide a binary representation of the given set of enum values - * with least significant digits rightmost. + * with the least significant digits rightmost. * @throws NullPointerException if {@code enumClass} or {@code values} is {@code null} * @throws IllegalArgumentException if {@code enumClass} is not an enum class, or if any {@code values} {@code null} * @since 3.2 @@ -166,7 +166,7 @@ public class EnumUtils { * @param values the values we want to convert, not {@code null}, neither containing {@code null} * @param the type of the enumeration * @return a long[] whose values provide a binary representation of the given set of enum values - * with least significant digits rightmost. + * with the least significant digits rightmost. * @throws NullPointerException if {@code enumClass} or {@code values} is {@code null} * @throws IllegalArgumentException if {@code enumClass} is not an enum class, or if any {@code values} {@code null} * @since 3.2 @@ -411,7 +411,7 @@ public class EnumUtils { * *

If you store this value, beware any changes to the enum that would affect ordinal values.

* @param enumClass the class of the enum we are working with, not {@code null} - * @param values the long[] bearing the representation of a set of enum values, least significant digits rightmost, not {@code null} + * @param values the long[] bearing the representation of a set of enum values, the least significant digits rightmost, not {@code null} * @param the type of the enumeration * @return a set of enum values * @throws NullPointerException if {@code enumClass} is {@code null} diff --git a/src/main/java/org/apache/commons/lang3/Functions.java b/src/main/java/org/apache/commons/lang3/Functions.java index 657315e5a..28da79388 100644 --- a/src/main/java/org/apache/commons/lang3/Functions.java +++ b/src/main/java/org/apache/commons/lang3/Functions.java @@ -516,7 +516,7 @@ public class Functions { * follow the method call, like a {@code return} statement from a value returning method. *

* - * @param throwable The throwable to rethrow ossibly wrapped into an unchecked exception + * @param throwable The throwable to rethrow possibly wrapped into an unchecked exception * @return Never returns anything, this method never terminates normally. */ public static RuntimeException rethrow(final Throwable throwable) { @@ -612,7 +612,7 @@ public class Functions { * {@link AutoCloseable} interface. The method executes the {@code action}. The method guarantees, that all * the {@code resources} are being executed, in the given order, afterwards, and regardless of success, or failure. * If either the original action, or any of the resource action fails, then the first failure (AKA - * {@link Throwable} is rethrown. Example use: + * {@link Throwable}) is rethrown. Example use: * *
      * {@code
@@ -673,7 +673,7 @@ public class Functions {
      * {@link AutoCloseable} interface. The method executes the {@code action}. The method guarantees, that all
      * the {@code resources} are being executed, in the given order, afterwards, and regardless of success, or failure.
      * If either the original action, or any of the resource action fails, then the first failure (AKA
-     * {@link Throwable} is rethrown. Example use:
+     * {@link Throwable}) is rethrown. Example use:
      *
      * 
      * {@code
diff --git a/src/main/java/org/apache/commons/lang3/LocaleUtils.java b/src/main/java/org/apache/commons/lang3/LocaleUtils.java
index bf492726c..31e35b7f7 100644
--- a/src/main/java/org/apache/commons/lang3/LocaleUtils.java
+++ b/src/main/java/org/apache/commons/lang3/LocaleUtils.java
@@ -158,7 +158,7 @@ public class LocaleUtils {
      * 

This method takes a country code and searches to find the * languages available for that country. Variant locales are removed.

* - * @param countryCode the 2 letter country code, null returns empty + * @param countryCode the 2-letter country code, null returns empty * @return an unmodifiable List of Locale objects, not null */ public static List languagesByCountry(final String countryCode) { diff --git a/src/main/java/org/apache/commons/lang3/Range.java b/src/main/java/org/apache/commons/lang3/Range.java index 02ad4e562..96931a755 100644 --- a/src/main/java/org/apache/commons/lang3/Range.java +++ b/src/main/java/org/apache/commons/lang3/Range.java @@ -39,8 +39,8 @@ public final class Range implements Serializable { /** * Comparable based compare implementation. * - * @param obj1 left hand side of comparison - * @param obj2 right hand side of comparison + * @param obj1 left-hand side of comparison + * @param obj2 right-hand side of comparison * @return negative, 0, positive comparison value */ @Override diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index 55061b4ee..8b49f66ab 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -482,7 +482,7 @@ public class StringUtils { /** * Appends the suffix to the end of the string if the string does not - * already end, case insensitive, with any of the suffixes. + * already end, case-insensitive, with any of the suffixes. * *
      * StringUtils.appendIfMissingIgnoreCase(null, null) = null
@@ -1455,7 +1455,7 @@ public class StringUtils {
             return 0;
         }
         int count = 0;
-        // We could also call str.toCharArray() for faster look ups but that would generate more garbage.
+        // We could also call str.toCharArray() for faster lookups but that would generate more garbage.
         for (int i = 0; i < str.length(); i++) {
             if (ch == str.charAt(i)) {
                 count++;
@@ -1669,7 +1669,7 @@ public class StringUtils {
      * 

Check if a CharSequence ends with a specified suffix.

* *

{@code null}s are handled without exceptions. Two {@code null} - * references are considered to be equal. The comparison is case sensitive.

+ * references are considered to be equal. The comparison is case-sensitive.

* *
      * StringUtils.endsWith(null, null)      = true
@@ -1684,7 +1684,7 @@ public class StringUtils {
      * @see java.lang.String#endsWith(String)
      * @param str  the CharSequence to check, may be null
      * @param suffix the suffix to find, may be null
-     * @return {@code true} if the CharSequence ends with the suffix, case sensitive, or
+     * @return {@code true} if the CharSequence ends with the suffix, case-sensitive, or
      *  both {@code null}
      * @since 2.4
      * @since 3.0 Changed signature from endsWith(String, String) to endsWith(CharSequence, CharSequence)
@@ -1700,7 +1700,7 @@ public class StringUtils {
      * @param str  the CharSequence to check, may be null
      * @param suffix the suffix to find, may be null
      * @param ignoreCase indicates whether the compare should ignore case
-     *  (case insensitive) or not.
+     *  (case-insensitive) or not.
      * @return {@code true} if the CharSequence starts with the prefix or
      *  both {@code null}
      */
@@ -1766,7 +1766,7 @@ public class StringUtils {
      * @see java.lang.String#endsWith(String)
      * @param str  the CharSequence to check, may be null
      * @param suffix the suffix to find, may be null
-     * @return {@code true} if the CharSequence ends with the suffix, case insensitive, or
+     * @return {@code true} if the CharSequence ends with the suffix, case-insensitive, or
      *  both {@code null}
      * @since 2.4
      * @since 3.0 Changed signature from endsWithIgnoreCase(String, String) to endsWithIgnoreCase(CharSequence, CharSequence)
@@ -1780,7 +1780,7 @@ public class StringUtils {
      * equal sequences of characters.

* *

{@code null}s are handled without exceptions. Two {@code null} - * references are considered to be equal. The comparison is case sensitive.

+ * references are considered to be equal. The comparison is case-sensitive.

* *
      * StringUtils.equals(null, null)   = true
@@ -2123,7 +2123,7 @@ public class StringUtils {
      *
      * @param term a full term that should be matched against, must not be null
      * @param query the query that will be matched against a term, must not be null
-     * @param locale This string matching logic is case insensitive. A locale is necessary to normalize
+     * @param locale This string matching logic is case-insensitive. A locale is necessary to normalize
      *  both Strings to lower case.
      * @return result score
      * @throws IllegalArgumentException if either String input {@code null} or Locale input {@code null}
@@ -2141,7 +2141,7 @@ public class StringUtils {
             throw new IllegalArgumentException("Locale must not be null");
         }
 
-        // fuzzy logic is case insensitive. We normalize the Strings to lower
+        // fuzzy logic is case-insensitive. We normalize the Strings to lower
         // case right from the start. Turning characters to lower case
         // via Character.toLowerCase(char) is unfortunately insufficient
         // as it does not accept a locale.
@@ -3537,7 +3537,7 @@ public class StringUtils {
      *
      * @param cs the CharSequence to check, may be null
      * @return {@code true} if every character is in the range
-     *  32 thru 126
+     *  32 through 126
      * @since 2.1
      * @since 3.0 Changed signature from isAsciiPrintable(String) to isAsciiPrintable(CharSequence)
      */
@@ -5682,7 +5682,7 @@ public class StringUtils {
         int index = lastIndex ? str.length() : INDEX_NOT_FOUND;
         do {
             if (lastIndex) {
-                index = CharSequenceUtils.lastIndexOf(str, searchStr, index - 1); // step backwards thru string
+                index = CharSequenceUtils.lastIndexOf(str, searchStr, index - 1); // step backwards through string
             } else {
                 index = CharSequenceUtils.indexOf(str, searchStr, index + 1); // step forwards through string
             }
@@ -5818,7 +5818,7 @@ public class StringUtils {
 
     /**
      * Prepends the prefix to the start of the string if the string does not
-     * already start, case insensitive, with any of the prefixes.
+     * already start, case-insensitive, with any of the prefixes.
      *
      * 
      * StringUtils.prependIfMissingIgnoreCase(null, null) = null
@@ -6022,7 +6022,7 @@ public class StringUtils {
      * 
* * @param str the source String to search, may be null - * @param remove the String to search for (case insensitive) and remove, may be null + * @param remove the String to search for (case-insensitive) and remove, may be null * @return the substring with the string removed if found, * {@code null} if null String input * @since 2.4 @@ -6113,7 +6113,7 @@ public class StringUtils { * @param str * the source String to search, may be null * @param remove - * the String to search for (case insensitive) and remove, may be + * the String to search for (case-insensitive) and remove, may be * null * @return the substring with the string removed if found, {@code null} if * null String input @@ -6244,7 +6244,7 @@ public class StringUtils { *
* * @param str the source String to search, may be null - * @param remove the String to search for (case insensitive) and remove, may be null + * @param remove the String to search for (case-insensitive) and remove, may be null * @return the substring with the string removed if found, * {@code null} if null String input * @since 2.4 @@ -6434,7 +6434,7 @@ public class StringUtils { /** *

Replaces a String with another String inside a larger String, * for the first {@code max} values of the search String, - * case sensitively/insensitively based on {@code ignoreCase} value.

+ * case-sensitively/insensitively based on {@code ignoreCase} value.

* *

A {@code null} reference passed to this method is a no-op.

* @@ -6455,10 +6455,10 @@ public class StringUtils { *
* * @param text text to search and replace in, may be null - * @param searchString the String to search for (case insensitive), may be null + * @param searchString the String to search for (case-insensitive), may be null * @param replacement the String to replace it with, may be null * @param max maximum number of values to replace, or {@code -1} if no maximum - * @param ignoreCase if true replace is case insensitive, otherwise case sensitive + * @param ignoreCase if true replace is case-insensitive, otherwise case-sensitive * @return the text with any replacements processed, * {@code null} if null String input */ @@ -6973,7 +6973,7 @@ public class StringUtils { * * @see #replaceIgnoreCase(String text, String searchString, String replacement, int max) * @param text text to search and replace in, may be null - * @param searchString the String to search for (case insensitive), may be null + * @param searchString the String to search for (case-insensitive), may be null * @param replacement the String to replace it with, may be null * @return the text with any replacements processed, * {@code null} if null String input @@ -7005,7 +7005,7 @@ public class StringUtils { *
* * @param text text to search and replace in, may be null - * @param searchString the String to search for (case insensitive), may be null + * @param searchString the String to search for (case-insensitive), may be null * @param replacement the String to replace it with, may be null * @param max maximum number of values to replace, or {@code -1} if no maximum * @return the text with any replacements processed, @@ -7062,7 +7062,7 @@ public class StringUtils { * * @see #replaceIgnoreCase(String text, String searchString, String replacement, int max) * @param text text to search and replace in, may be null - * @param searchString the String to search for (case insensitive), may be null + * @param searchString the String to search for (case-insensitive), may be null * @param replacement the String to replace with, may be null * @return the text with any replacements processed, * {@code null} if null String input @@ -8063,7 +8063,7 @@ public class StringUtils { *

Check if a CharSequence starts with a specified prefix.

* *

{@code null}s are handled without exceptions. Two {@code null} - * references are considered to be equal. The comparison is case sensitive.

+ * references are considered to be equal. The comparison is case-sensitive.

* *
      * StringUtils.startsWith(null, null)      = true
@@ -8076,7 +8076,7 @@ public class StringUtils {
      * @see java.lang.String#startsWith(String)
      * @param str  the CharSequence to check, may be null
      * @param prefix the prefix to find, may be null
-     * @return {@code true} if the CharSequence starts with the prefix, case sensitive, or
+     * @return {@code true} if the CharSequence starts with the prefix, case-sensitive, or
      *  both {@code null}
      * @since 2.4
      * @since 3.0 Changed signature from startsWith(String, String) to startsWith(CharSequence, CharSequence)
@@ -8092,7 +8092,7 @@ public class StringUtils {
      * @param str  the CharSequence to check, may be null
      * @param prefix the prefix to find, may be null
      * @param ignoreCase indicates whether the compare should ignore case
-     *  (case insensitive) or not.
+     *  (case-insensitive) or not.
      * @return {@code true} if the CharSequence starts with the prefix or
      *  both {@code null}
      */
@@ -8159,7 +8159,7 @@ public class StringUtils {
      * @see java.lang.String#startsWith(String)
      * @param str  the CharSequence to check, may be null
      * @param prefix the prefix to find, may be null
-     * @return {@code true} if the CharSequence starts with the prefix, case insensitive, or
+     * @return {@code true} if the CharSequence starts with the prefix, case-insensitive, or
      *  both {@code null}
      * @since 2.4
      * @since 3.0 Changed signature from startsWithIgnoreCase(String, String) to startsWithIgnoreCase(CharSequence, CharSequence)
@@ -9450,7 +9450,7 @@ public class StringUtils {
      * should be used with a specific locale (e.g. {@link Locale#ENGLISH}).

* * @param str the String to upper case, may be null - * @return the upper cased String, {@code null} if null String input + * @return the upper-cased String, {@code null} if null String input */ public static String upperCase(final String str) { if (str == null) { @@ -9472,7 +9472,7 @@ public class StringUtils { * * @param str the String to upper case, may be null * @param locale the locale that defines the case transformation rules, must not be null - * @return the upper cased String, {@code null} if null String input + * @return the upper-cased String, {@code null} if null String input * @since 2.5 */ public static String upperCase(final String str, final Locale locale) { diff --git a/src/main/java/org/apache/commons/lang3/arch/Processor.java b/src/main/java/org/apache/commons/lang3/arch/Processor.java index e9654106d..c9dcbdf7e 100644 --- a/src/main/java/org/apache/commons/lang3/arch/Processor.java +++ b/src/main/java/org/apache/commons/lang3/arch/Processor.java @@ -143,7 +143,7 @@ public class Processor { /** * Gets the processor type as {@link Type} enum. * The processor type defines, if the processor is for example - * a x86 or PPA. + * an x86 or PPA. * * @return A {@link Type} enum. */ diff --git a/src/main/java/org/apache/commons/lang3/builder/CompareToBuilder.java b/src/main/java/org/apache/commons/lang3/builder/CompareToBuilder.java index c006e05be..bd93a37aa 100644 --- a/src/main/java/org/apache/commons/lang3/builder/CompareToBuilder.java +++ b/src/main/java/org/apache/commons/lang3/builder/CompareToBuilder.java @@ -433,7 +433,7 @@ public class CompareToBuilder implements Builder { private void appendArray(final Object lhs, final Object rhs, final Comparator comparator) { // switch on type of array, to dispatch to the correct handler - // handles multi dimensional arrays + // handles multidimensional arrays // throws a ClassCastException if rhs is not the correct array type if (lhs instanceof long[]) { append((long[]) lhs, (long[]) rhs); diff --git a/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java b/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java index e39f32564..183a0450a 100644 --- a/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java +++ b/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java @@ -158,9 +158,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code boolean} + * the left-hand {@code boolean} * @param rhs - * the right hand {@code boolean} + * the right-hand {@code boolean} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -198,9 +198,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code boolean[]} + * the left-hand {@code boolean[]} * @param rhs - * the right hand {@code boolean[]} + * the right-hand {@code boolean[]} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -237,9 +237,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code byte} + * the left-hand {@code byte} * @param rhs - * the right hand {@code byte} + * the right-hand {@code byte} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -276,9 +276,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code byte[]} + * the left-hand {@code byte[]} * @param rhs - * the right hand {@code byte[]} + * the right-hand {@code byte[]} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -316,9 +316,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code char} + * the left-hand {@code char} * @param rhs - * the right hand {@code char} + * the right-hand {@code char} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -356,9 +356,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code char[]} + * the left-hand {@code char[]} * @param rhs - * the right hand {@code char[]} + * the right-hand {@code char[]} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -396,9 +396,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code double} + * the left-hand {@code double} * @param rhs - * the right hand {@code double} + * the right-hand {@code double} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -436,9 +436,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code double[]} + * the left-hand {@code double[]} * @param rhs - * the right hand {@code double[]} + * the right-hand {@code double[]} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -476,9 +476,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code float} + * the left-hand {@code float} * @param rhs - * the right hand {@code float} + * the right-hand {@code float} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -516,9 +516,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code float[]} + * the left-hand {@code float[]} * @param rhs - * the right hand {@code float[]} + * the right-hand {@code float[]} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -556,9 +556,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code int} + * the left-hand {@code int} * @param rhs - * the right hand {@code int} + * the right-hand {@code int} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -596,9 +596,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code int[]} + * the left-hand {@code int[]} * @param rhs - * the right hand {@code int[]} + * the right-hand {@code int[]} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -636,9 +636,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code long} + * the left-hand {@code long} * @param rhs - * the right hand {@code long} + * the right-hand {@code long} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -676,9 +676,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code long[]} + * the left-hand {@code long[]} * @param rhs - * the right hand {@code long[]} + * the right-hand {@code long[]} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -716,9 +716,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code short} + * the left-hand {@code short} * @param rhs - * the right hand {@code short} + * the right-hand {@code short} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -756,9 +756,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code short[]} + * the left-hand {@code short[]} * @param rhs - * the right hand {@code short[]} + * the right-hand {@code short[]} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -796,9 +796,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@link Object} + * the left-hand {@link Object} * @param rhs - * the right hand {@link Object} + * the right-hand {@link Object} * @return this * @throws IllegalArgumentException * if field name is {@code null} @@ -880,9 +880,9 @@ public class DiffBuilder implements Builder> { * @param fieldName * the field name * @param lhs - * the left hand {@code Object[]} + * the left-hand {@code Object[]} * @param rhs - * the right hand {@code Object[]} + * the right-hand {@code Object[]} * @return this * @throws IllegalArgumentException * if field name is {@code null} diff --git a/src/main/java/org/apache/commons/lang3/builder/DiffResult.java b/src/main/java/org/apache/commons/lang3/builder/DiffResult.java index 4e2ef64b1..df1ec7e5b 100644 --- a/src/main/java/org/apache/commons/lang3/builder/DiffResult.java +++ b/src/main/java/org/apache/commons/lang3/builder/DiffResult.java @@ -60,9 +60,9 @@ public class DiffResult implements Iterable> { *

* * @param lhs - * the left hand object + * the left-hand object * @param rhs - * the right hand object + * the right-hand object * @param diffList * the list of differences, may be empty * @param style diff --git a/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java b/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java index 72fe72e3a..67c8cb434 100644 --- a/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java +++ b/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java @@ -438,7 +438,7 @@ public class EqualsBuilder implements Builder { * @param testTransients whether to include transient fields * @param reflectUpToClass the superclass to reflect up to (inclusive), * may be {@code null} - * @param testRecursive whether to call reflection equals on non primitive + * @param testRecursive whether to call reflection equals on non-primitive * fields recursively. * @param excludeFields array of field names to exclude from testing * @return {@code true} if the two Objects have tested equals. @@ -484,10 +484,10 @@ public class EqualsBuilder implements Builder { * *

If either class of the compared objects is contained in * {@code bypassReflectionClasses}, both objects are compared by calling - * the equals method of the left hand object with the right hand object as an argument.

+ * the equals method of the left-hand object with the right-hand object as an argument.

* - * @param lhs the left hand object - * @param rhs the left hand object + * @param lhs the left-hand object + * @param rhs the right-hand object * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder reflectionAppend(final Object lhs, final Object rhs) { @@ -556,8 +556,8 @@ public class EqualsBuilder implements Builder { *

Appends the fields and values defined by the given object of the * given Class.

* - * @param lhs the left hand object - * @param rhs the right hand object + * @param lhs the left-hand object + * @param rhs the right-hand object * @param clazz the class to append details of */ private void reflectionAppend( @@ -616,8 +616,8 @@ public class EqualsBuilder implements Builder { * is set to {@code false}. Otherwise, using their * {@code equals} method.

* - * @param lhs the left hand object - * @param rhs the right hand object + * @param lhs the left-hand object + * @param rhs the right-hand object * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final Object lhs, final Object rhs) { @@ -648,13 +648,13 @@ public class EqualsBuilder implements Builder { /** *

Test if an {@link Object} is equal to an array.

* - * @param lhs the left hand object, an array - * @param rhs the right hand object + * @param lhs the left-hand object, an array + * @param rhs the right-hand object */ private void appendArray(final Object lhs, final Object rhs) { // First we compare different dimensions, for example: a boolean[][] to a boolean[] // then we 'Switch' on type of array, to dispatch to the correct handler - // This handles multi dimensional arrays of the same depth + // This handles multidimensional arrays of the same depth if (lhs.getClass() != rhs.getClass()) { this.setEquals(false); } else if (lhs instanceof long[]) { @@ -685,9 +685,9 @@ public class EqualsBuilder implements Builder { *

* * @param lhs - * the left hand {@code long} + * the left-hand {@code long} * @param rhs - * the right hand {@code long} + * the right-hand {@code long} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final long lhs, final long rhs) { @@ -701,8 +701,8 @@ public class EqualsBuilder implements Builder { /** *

Test if two {@code int}s are equal.

* - * @param lhs the left hand {@code int} - * @param rhs the right hand {@code int} + * @param lhs the left-hand {@code int} + * @param rhs the right-hand {@code int} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final int lhs, final int rhs) { @@ -716,8 +716,8 @@ public class EqualsBuilder implements Builder { /** *

Test if two {@code short}s are equal.

* - * @param lhs the left hand {@code short} - * @param rhs the right hand {@code short} + * @param lhs the left-hand {@code short} + * @param rhs the right-hand {@code short} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final short lhs, final short rhs) { @@ -731,8 +731,8 @@ public class EqualsBuilder implements Builder { /** *

Test if two {@code char}s are equal.

* - * @param lhs the left hand {@code char} - * @param rhs the right hand {@code char} + * @param lhs the left-hand {@code char} + * @param rhs the right-hand {@code char} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final char lhs, final char rhs) { @@ -746,8 +746,8 @@ public class EqualsBuilder implements Builder { /** *

Test if two {@code byte}s are equal.

* - * @param lhs the left hand {@code byte} - * @param rhs the right hand {@code byte} + * @param lhs the left-hand {@code byte} + * @param rhs the right-hand {@code byte} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final byte lhs, final byte rhs) { @@ -767,8 +767,8 @@ public class EqualsBuilder implements Builder { *

It is compatible with the hash code generated by * {@link HashCodeBuilder}.

* - * @param lhs the left hand {@code double} - * @param rhs the right hand {@code double} + * @param lhs the left-hand {@code double} + * @param rhs the right-hand {@code double} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final double lhs, final double rhs) { @@ -787,8 +787,8 @@ public class EqualsBuilder implements Builder { *

It is compatible with the hash code generated by * {@link HashCodeBuilder}.

* - * @param lhs the left hand {@code float} - * @param rhs the right hand {@code float} + * @param lhs the left-hand {@code float} + * @param rhs the right-hand {@code float} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final float lhs, final float rhs) { @@ -801,8 +801,8 @@ public class EqualsBuilder implements Builder { /** *

Test if two {@code booleans}s are equal.

* - * @param lhs the left hand {@code boolean} - * @param rhs the right hand {@code boolean} + * @param lhs the left-hand {@code boolean} + * @param rhs the right-hand {@code boolean} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final boolean lhs, final boolean rhs) { @@ -822,8 +822,8 @@ public class EqualsBuilder implements Builder { *

Note that this method does not compare the type of the arrays; it only * compares the contents.

* - * @param lhs the left hand {@code Object[]} - * @param rhs the right hand {@code Object[]} + * @param lhs the left-hand {@code Object[]} + * @param rhs the right-hand {@code Object[]} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final Object[] lhs, final Object[] rhs) { @@ -853,8 +853,8 @@ public class EqualsBuilder implements Builder { * *

The method {@link #append(long, long)} is used.

* - * @param lhs the left hand {@code long[]} - * @param rhs the right hand {@code long[]} + * @param lhs the left-hand {@code long[]} + * @param rhs the right-hand {@code long[]} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final long[] lhs, final long[] rhs) { @@ -884,8 +884,8 @@ public class EqualsBuilder implements Builder { * *

The method {@link #append(int, int)} is used.

* - * @param lhs the left hand {@code int[]} - * @param rhs the right hand {@code int[]} + * @param lhs the left-hand {@code int[]} + * @param rhs the right-hand {@code int[]} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final int[] lhs, final int[] rhs) { @@ -915,8 +915,8 @@ public class EqualsBuilder implements Builder { * *

The method {@link #append(short, short)} is used.

* - * @param lhs the left hand {@code short[]} - * @param rhs the right hand {@code short[]} + * @param lhs the left-hand {@code short[]} + * @param rhs the right-hand {@code short[]} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final short[] lhs, final short[] rhs) { @@ -946,8 +946,8 @@ public class EqualsBuilder implements Builder { * *

The method {@link #append(char, char)} is used.

* - * @param lhs the left hand {@code char[]} - * @param rhs the right hand {@code char[]} + * @param lhs the left-hand {@code char[]} + * @param rhs the right-hand {@code char[]} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final char[] lhs, final char[] rhs) { @@ -977,8 +977,8 @@ public class EqualsBuilder implements Builder { * *

The method {@link #append(byte, byte)} is used.

* - * @param lhs the left hand {@code byte[]} - * @param rhs the right hand {@code byte[]} + * @param lhs the left-hand {@code byte[]} + * @param rhs the right-hand {@code byte[]} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final byte[] lhs, final byte[] rhs) { @@ -1008,8 +1008,8 @@ public class EqualsBuilder implements Builder { * *

The method {@link #append(double, double)} is used.

* - * @param lhs the left hand {@code double[]} - * @param rhs the right hand {@code double[]} + * @param lhs the left-hand {@code double[]} + * @param rhs the right-hand {@code double[]} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final double[] lhs, final double[] rhs) { @@ -1039,8 +1039,8 @@ public class EqualsBuilder implements Builder { * *

The method {@link #append(float, float)} is used.

* - * @param lhs the left hand {@code float[]} - * @param rhs the right hand {@code float[]} + * @param lhs the left-hand {@code float[]} + * @param rhs the right-hand {@code float[]} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final float[] lhs, final float[] rhs) { @@ -1070,8 +1070,8 @@ public class EqualsBuilder implements Builder { * *

The method {@link #append(boolean, boolean)} is used.

* - * @param lhs the left hand {@code boolean[]} - * @param rhs the right hand {@code boolean[]} + * @param lhs the left-hand {@code boolean[]} + * @param rhs the right-hand {@code boolean[]} * @return EqualsBuilder - used to chain calls. */ public EqualsBuilder append(final boolean[] lhs, final boolean[] rhs) { diff --git a/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java b/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java index 48b177eb0..fe87282cf 100644 --- a/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java +++ b/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java @@ -857,7 +857,7 @@ public class HashCodeBuilder implements Builder { */ private void appendArray(final Object object) { // 'Switch' on type of array, to dispatch to the correct handler - // This handles multi dimensional arrays + // This handles multidimensional arrays if (object instanceof long[]) { append((long[]) object); } else if (object instanceof int[]) { diff --git a/src/main/java/org/apache/commons/lang3/builder/RecursiveToStringStyle.java b/src/main/java/org/apache/commons/lang3/builder/RecursiveToStringStyle.java index ef974e8e5..9a805a308 100644 --- a/src/main/java/org/apache/commons/lang3/builder/RecursiveToStringStyle.java +++ b/src/main/java/org/apache/commons/lang3/builder/RecursiveToStringStyle.java @@ -86,7 +86,7 @@ public class RecursiveToStringStyle extends ToStringStyle { /** * Returns whether or not to recursively format the given {@link Class}. * By default, this method always returns {@code true}, but may be overwritten by - * sub-classes to filter specific classes. + * subclasses to filter specific classes. * * @param clazz * The class to test. diff --git a/src/main/java/org/apache/commons/lang3/compare/ComparableUtils.java b/src/main/java/org/apache/commons/lang3/compare/ComparableUtils.java index 4241363dc..87be32509 100644 --- a/src/main/java/org/apache/commons/lang3/compare/ComparableUtils.java +++ b/src/main/java/org/apache/commons/lang3/compare/ComparableUtils.java @@ -215,7 +215,7 @@ public class ComparableUtils { * @param Type of what we are comparing. * @param comparable1 an argument. * @param comparable2 another argument. - * @return the larger of {@code c1} and {@code c2}. + * @return the largest of {@code c1} and {@code c2}. * @see ObjectUtils#max(Comparable...) * @since 3.13.0 */ @@ -232,7 +232,7 @@ public class ComparableUtils { * @param Type of what we are comparing. * @param comparable1 an argument. * @param comparable2 another argument. - * @return the larger of {@code c1} and {@code c2}. + * @return the largest of {@code c1} and {@code c2}. * @see ObjectUtils#min(Comparable...) * @since 3.13.0 */ diff --git a/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java b/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java index 0f819c57e..9f0cd92c8 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java @@ -257,7 +257,7 @@ public class TimedSemaphore { } /** - * Initializes a shutdown. After that the object cannot be used any more. + * Initializes a shutdown. After that the object cannot be used anymore. * This method can be invoked an arbitrary number of times. All invocations * after the first one do not have any effect. */ @@ -357,7 +357,7 @@ public class TimedSemaphore { * can give an indication whether it is safe to call the {@link #acquire()} * method without risking to be suspended. However, there is no guarantee * that a subsequent call to {@link #acquire()} actually is not-blocking - * because in the mean time other threads may have invoked the semaphore. + * because in the meantime other threads may have invoked the semaphore. * * @return the current number of available {@link #acquire()} calls in the * current period diff --git a/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java b/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java index 8b87ee060..db2ac8fdb 100644 --- a/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java +++ b/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java @@ -80,7 +80,7 @@ public class EventListenerSupport implements Serializable { /** * The proxy representing the collection of listeners. Calls to this proxy - * object will sent to all registered listeners. + * object will be sent to all registered listeners. */ private transient L proxy; diff --git a/src/main/java/org/apache/commons/lang3/function/Failable.java b/src/main/java/org/apache/commons/lang3/function/Failable.java index d94757a47..cdcfccce3 100644 --- a/src/main/java/org/apache/commons/lang3/function/Failable.java +++ b/src/main/java/org/apache/commons/lang3/function/Failable.java @@ -403,7 +403,7 @@ public class Failable { * follow the method call, like a {@code return} statement from a value returning method. *

* - * @param throwable The throwable to rethrow ossibly wrapped into an unchecked exception + * @param throwable The throwable to rethrow possibly wrapped into an unchecked exception * @return Never returns anything, this method never terminates normally. */ public static RuntimeException rethrow(final Throwable throwable) { @@ -498,7 +498,7 @@ public class Failable { * {@link AutoCloseable} interface. The method executes the {@code action}. The method guarantees, that all * the {@code resources} are being executed, in the given order, afterwards, and regardless of success, or failure. * If either the original action, or any of the resource action fails, then the first failure (AKA - * {@link Throwable} is rethrown. Example use: + * {@link Throwable}) is rethrown. Example use: * *
      * final FileInputStream fis = new FileInputStream("my.file");
@@ -558,7 +558,7 @@ public class Failable {
      * {@link AutoCloseable} interface. The method executes the {@code action}. The method guarantees, that all
      * the {@code resources} are being executed, in the given order, afterwards, and regardless of success, or failure.
      * If either the original action, or any of the resource action fails, then the first failure (AKA
-     * {@link Throwable} is rethrown. Example use:
+     * {@link Throwable}) is rethrown. Example use:
      *
      * 
      * final FileInputStream fis = new FileInputStream("my.file");
diff --git a/src/main/java/org/apache/commons/lang3/function/FailableFunction.java b/src/main/java/org/apache/commons/lang3/function/FailableFunction.java
index 5eb586acc..ef088c960 100644
--- a/src/main/java/org/apache/commons/lang3/function/FailableFunction.java
+++ b/src/main/java/org/apache/commons/lang3/function/FailableFunction.java
@@ -85,7 +85,7 @@ public interface FailableFunction {
      *
      * @param  the input type to the {@code before} function, and to the composed function.
      * @param before the operator to apply before this one.
-     * @return a a composed {@link FailableFunction} like {@link Function#compose(Function)}.
+     * @return a composed {@link FailableFunction} like {@link Function#compose(Function)}.
      * @throws NullPointerException if before is null.
      * @see #andThen(FailableFunction)
      */
diff --git a/src/main/java/org/apache/commons/lang3/math/Fraction.java b/src/main/java/org/apache/commons/lang3/math/Fraction.java
index 6c9b310f9..3d265fc44 100644
--- a/src/main/java/org/apache/commons/lang3/math/Fraction.java
+++ b/src/main/java/org/apache/commons/lang3/math/Fraction.java
@@ -593,7 +593,7 @@ public final class Fraction extends Number implements Comparable {
         do {
             /* assert u<0 && v<0; */
             // B4/B3: cast out twos from t.
-            while ((t & 1) == 0) { // while t is even..
+            while ((t & 1) == 0) { // while t is even.
                 t /= 2; // cast out twos
             }
             // B5 [reset max(u,v)]
diff --git a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
index e7bea3afa..a57c5f870 100644
--- a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
+++ b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
@@ -305,7 +305,7 @@ public class NumberUtils {
      *
      * 
      *   NumberUtils.toDouble(null)                     = 0.0d
-     *   NumberUtils.toDouble(BigDecimal.valudOf(8.5d)) = 8.5d
+     *   NumberUtils.toDouble(BigDecimal.valueOf(8.5d)) = 8.5d
      * 
* * @param value the {@link BigDecimal} to convert, may be {@code null}. @@ -325,7 +325,7 @@ public class NumberUtils { * *
      *   NumberUtils.toDouble(null, 1.1d)                     = 1.1d
-     *   NumberUtils.toDouble(BigDecimal.valudOf(8.5d), 1.1d) = 8.5d
+     *   NumberUtils.toDouble(BigDecimal.valueOf(8.5d), 1.1d) = 8.5d
      * 
* * @param value the {@link BigDecimal} to convert, may be {@code null}. @@ -733,7 +733,7 @@ public class NumberUtils { } else { exp = null; } - //Requesting a specific type.. + //Requesting a specific type. final String numeric = str.substring(0, length - 1); switch (lastChar) { case 'l' : diff --git a/src/main/java/org/apache/commons/lang3/mutable/MutableInt.java b/src/main/java/org/apache/commons/lang3/mutable/MutableInt.java index 9698f5219..245cb8de3 100644 --- a/src/main/java/org/apache/commons/lang3/mutable/MutableInt.java +++ b/src/main/java/org/apache/commons/lang3/mutable/MutableInt.java @@ -314,7 +314,7 @@ public class MutableInt extends Number implements Comparable, Mutabl /** * Gets this mutable as an instance of Integer. * - * @return a Integer instance containing the value from this mutable, never null + * @return an Integer instance containing the value from this mutable, never null */ public Integer toInteger() { return Integer.valueOf(intValue()); diff --git a/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java b/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java index f79383913..eb62b56da 100644 --- a/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java +++ b/src/main/java/org/apache/commons/lang3/reflect/MemberUtils.java @@ -203,7 +203,7 @@ final class MemberUtils { } /** - * Gets the number of steps required needed to turn the source class into + * Gets the number of steps needed to turn the source class into * the destination class. This represents the number of steps in the object * hierarchy graph. * @param srcClass The source class diff --git a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java index ec86b28cb..5e54ea914 100644 --- a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java +++ b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java @@ -891,7 +891,7 @@ public class MethodUtils { * @param searchSupers * determines if a lookup in the entire inheritance hierarchy of the given class should be performed * @param ignoreAccess - * determines if non public methods should be considered + * determines if non-public methods should be considered * @return an array of Methods (possibly empty). * @throws NullPointerException if the class or annotation are {@code null} * @since 3.6 @@ -910,7 +910,7 @@ public class MethodUtils { * @param searchSupers * determines if a lookup in the entire inheritance hierarchy of the given class should be performed * @param ignoreAccess - * determines if non public methods should be considered + * determines if non-public methods should be considered * @return a list of Methods (possibly empty). * @throws NullPointerException if either the class or annotation class is {@code null} * @since 3.6 diff --git a/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java b/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java index f6bfca253..c8ead80a3 100644 --- a/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java +++ b/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java @@ -1805,7 +1805,7 @@ public class TypeUtils { * found is not a type variable. * * @param typeVariable the type variable to look up - * @param typeVarAssigns the map used for the look up + * @param typeVarAssigns the map used for the look-up * @return Type or {@code null} if some variable was not in the map * @since 3.2 */ diff --git a/src/main/java/org/apache/commons/lang3/text/StrBuilder.java b/src/main/java/org/apache/commons/lang3/text/StrBuilder.java index a63f762ba..075b57ace 100644 --- a/src/main/java/org/apache/commons/lang3/text/StrBuilder.java +++ b/src/main/java/org/apache/commons/lang3/text/StrBuilder.java @@ -1502,7 +1502,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build /** * Appends an object to the builder padding on the left to a fixed width. * The {@code toString} of the object is used. - * If the object is larger than the length, the left hand side is lost. + * If the object is larger than the length, the left-hand side is lost. * If the object is null, the null text value is used. * * @param obj the object to append, null uses null text @@ -1535,7 +1535,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build /** * Appends an object to the builder padding on the left to a fixed width. * The {@code String.valueOf} of the {@code int} value is used. - * If the formatted value is larger than the length, the left hand side is lost. + * If the formatted value is larger than the length, the left-hand side is lost. * * @param value the value to append * @param width the fixed field width, zero or negative has no effect @@ -1549,7 +1549,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build /** * Appends an object to the builder padding on the right to a fixed length. * The {@code toString} of the object is used. - * If the object is larger than the length, the right hand side is lost. + * If the object is larger than the length, the right-hand side is lost. * If the object is null, null text value is used. * * @param obj the object to append, null uses null text @@ -1582,7 +1582,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build /** * Appends an object to the builder padding on the right to a fixed length. * The {@code String.valueOf} of the {@code int} value is used. - * If the object is larger than the length, the right hand side is lost. + * If the object is larger than the length, the right-hand side is lost. * * @param value the value to append * @param width the fixed field width, zero or negative has no effect diff --git a/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java b/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java index b85c43e12..a39260d8e 100644 --- a/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java +++ b/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java @@ -765,7 +765,7 @@ public class StrSubstitutor { /** * Recursive handler for multiple levels of interpolation. This is the main * interpolation method, which resolves the values of all variable references - * contained in the passed in text. + * contained in the passed-in text. * * @param buf the string builder to substitute into, not null * @param offset the start offset within the builder, must be valid diff --git a/src/main/java/org/apache/commons/lang3/text/StrTokenizer.java b/src/main/java/org/apache/commons/lang3/text/StrTokenizer.java index f1f9331ed..cb5434255 100644 --- a/src/main/java/org/apache/commons/lang3/text/StrTokenizer.java +++ b/src/main/java/org/apache/commons/lang3/text/StrTokenizer.java @@ -797,7 +797,7 @@ public class StrTokenizer implements ListIterator, Cloneable { } // check for trimmed character - // don't yet know if its at the end, so copy to workArea + // don't yet know if it's at the end, so copy to workArea // use trimStart to keep track of trim at the end final int trimmedLen = getTrimmerMatcher().isMatch(srcChars, pos, start, len); if (trimmedLen > 0) { diff --git a/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java b/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java index 8a5fa44f8..44156bd7e 100644 --- a/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java +++ b/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java @@ -115,14 +115,14 @@ public class DurationFormatUtils { /** *

Formats the time gap as a string, using the specified format. - * Padding the left hand side of numbers with zeroes is optional.

+ * Padding the left-hand side of numbers with zeroes is optional.

* *

This method formats durations using the days and lower fields of the * format pattern. Months and larger are not used.

* * @param durationMillis the duration to format * @param format the way in which to format the duration, not null - * @param padWithZeros whether to pad the left hand side of numbers with 0's + * @param padWithZeros whether to pad the left-hand side of numbers with 0's * @return the formatted duration, not null * @throws IllegalArgumentException if durationMillis is negative */ @@ -238,7 +238,7 @@ public class DurationFormatUtils { /** *

Formats the time gap as a string, using the specified format. - * Padding the left hand side of numbers with zeroes is optional. + * Padding the left-hand side of numbers with zeroes is optional. * * @param startMillis the start of the duration * @param endMillis the end of the duration @@ -252,7 +252,7 @@ public class DurationFormatUtils { /** *

Formats the time gap as a string, using the specified format. - * Padding the left hand side of numbers with zeroes is optional and + * Padding the left-hand side of numbers with zeroes is optional and * the time zone may be specified.

* *

When calculating the difference between months/days, it chooses to @@ -269,7 +269,7 @@ public class DurationFormatUtils { * @param startMillis the start of the duration * @param endMillis the end of the duration * @param format the way in which to format the duration, not null - * @param padWithZeros whether to pad the left hand side of numbers with 0's + * @param padWithZeros whether to pad the left-hand side of numbers with 0's * @param timezone the millis are defined in * @return the formatted duration, not null * @throws IllegalArgumentException if startMillis is greater than endMillis diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java b/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java index 497bb7c42..e88194805 100644 --- a/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java +++ b/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java @@ -390,7 +390,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter { * @param pattern {@link java.text.SimpleDateFormat} compatible pattern * @param timeZone non-null time zone to use * @param locale non-null locale to use - * @param centuryStart The start of the 100 year period to use as the "default century" for 2 digit year parsing. If centuryStart is null, defaults to now - 80 years + * @param centuryStart The start of the 100-year period to use as the "default century" for 2 digit year parsing. If centuryStart is null, defaults to now - 80 years * @throws NullPointerException if pattern, timeZone, or locale is null. */ protected FastDateFormat(final String pattern, final TimeZone timeZone, final Locale locale, final Date centuryStart) { diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java index 7539b2793..d67045455 100644 --- a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java +++ b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java @@ -952,7 +952,7 @@ public class FastDateParser implements DateParser, Serializable { } } // order the regex alternatives with longer strings first, greedy - // match will ensure longest string will be consumed + // match will ensure the longest string will be consumed for (final String zoneName : sorted) { simpleQuote(sb.append('|'), zoneName); } diff --git a/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java b/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java index ea6e682ba..bf270c441 100644 --- a/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java +++ b/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java @@ -83,7 +83,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { // A lot of the speed in this class comes from caching, but some comes // from the special int to StringBuffer conversion. // - // The following produces a padded 2 digit number: + // The following produces a padded 2-digit number: // buffer.append((char)(value / 10 + '0')); // buffer.append((char)(value % 10 + '0')); // @@ -461,7 +461,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { /** * Creates a String representation of the given Calendar by applying the rules of this printer to it. - * @param c the Calender to apply the rules to. + * @param c the Calendar to apply the rules to. * @return a String representation of the given Calendar. */ private String applyRulesToString(final Calendar c) { @@ -1449,7 +1449,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { * Factory method for Iso8601_Rules. * * @param tokenLen a token indicating the length of the TimeZone String to be formatted. - * @return a Iso8601_Rule that can format TimeZone String of length {@code tokenLen}. If no such + * @return an Iso8601_Rule that can format TimeZone String of length {@code tokenLen}. If no such * rule exists, an IllegalArgumentException will be thrown. */ static Iso8601_Rule getRule(final int tokenLen) { diff --git a/src/main/java/org/apache/commons/lang3/time/FormatCache.java b/src/main/java/org/apache/commons/lang3/time/FormatCache.java index 5ce458d25..586e660b6 100644 --- a/src/main/java/org/apache/commons/lang3/time/FormatCache.java +++ b/src/main/java/org/apache/commons/lang3/time/FormatCache.java @@ -193,7 +193,7 @@ abstract class FormatCache { } /** - * Helper class to hold multi-part Map keys as arrays. + * Helper class to hold multipart Map keys as arrays. */ private static final class ArrayKey { diff --git a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java index 0a28dfe1f..fc55943f9 100644 --- a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java @@ -437,7 +437,7 @@ public class ObjectUtilsTest extends AbstractLangTest { @Test public void testGetFirstNonNull() { - // first non null + // first non-null assertEquals("", ObjectUtils.getFirstNonNull(() -> null, () -> "")); // first encountered value is used assertEquals("1", ObjectUtils.getFirstNonNull(() -> null, () -> "1", () -> "2", () -> null)); diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsSubstringTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsSubstringTest.java index 87b47150d..a6f6bf5d0 100644 --- a/src/test/java/org/apache/commons/lang3/StringUtilsSubstringTest.java +++ b/src/test/java/org/apache/commons/lang3/StringUtilsSubstringTest.java @@ -290,7 +290,7 @@ public class StringUtilsSubstringTest extends AbstractLangTest { } /** - * Tests the substringsBetween method that returns an String Array of substrings. + * Tests the substringsBetween method that returns a String Array of substrings. */ @Test public void testSubstringsBetween_StringStringString() { diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java index 204e7eb58..f7f035c4b 100644 --- a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java @@ -1723,7 +1723,7 @@ public class StringUtilsTest extends AbstractLangTest { assertEquals(StringUtils.removeEndIgnoreCase("domain.com", ""), "domain.com", "removeEndIgnoreCase(\"domain.com\", \"\")"); assertEquals(StringUtils.removeEndIgnoreCase("domain.com", null), "domain.com", "removeEndIgnoreCase(\"domain.com\", null)"); - // Case insensitive: + // Case-insensitive: assertEquals(StringUtils.removeEndIgnoreCase("www.domain.com", ".COM"), "www.domain", "removeEndIgnoreCase(\"www.domain.com\", \".COM\")"); assertEquals(StringUtils.removeEndIgnoreCase("www.domain.COM", ".com"), "www.domain", "removeEndIgnoreCase(\"www.domain.COM\", \".com\")"); } @@ -1861,7 +1861,7 @@ public class StringUtilsTest extends AbstractLangTest { assertEquals(StringUtils.removeStartIgnoreCase("domain.com", ""), "domain.com", "removeStartIgnoreCase(\"domain.com\", \"\")"); assertEquals(StringUtils.removeStartIgnoreCase("domain.com", null), "domain.com", "removeStartIgnoreCase(\"domain.com\", null)"); - // Case insensitive: + // Case-insensitive: assertEquals(StringUtils.removeStartIgnoreCase("www.domain.com", "WWW."), "domain.com", "removeStartIgnoreCase(\"www.domain.com\", \"WWW.\")"); } diff --git a/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java index 2048be5b3..9e972760a 100644 --- a/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java @@ -342,7 +342,7 @@ public class EqualsBuilderTest extends AbstractLangTest { * * @param to a TestObject * @param toBis a TestObject, equal to to and toTer - * @param toTer Left hand side, equal to to and toBis + * @param toTer left-hand side, equal to to and toBis * @param to2 a different TestObject * @param oToChange a TestObject that will be changed * @param testTransients whether to test transient instance variables diff --git a/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderAndEqualsBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderAndEqualsBuilderTest.java index 46cf1b85d..b12f61e22 100644 --- a/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderAndEqualsBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderAndEqualsBuilderTest.java @@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test; /** * Tests {@link org.apache.commons.lang3.builder.HashCodeBuilder} and - * {@link org.apache.commons.lang3.builder.EqualsBuilderTest} to insure that equal + * {@link org.apache.commons.lang3.builder.EqualsBuilderTest} to ensure that equal * objects must have equal hash codes. */ public class HashCodeBuilderAndEqualsBuilderTest extends AbstractLangTest { diff --git a/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java b/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java index ce82e6306..b12d66950 100644 --- a/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java @@ -53,7 +53,7 @@ public class ExceptionUtilsTest extends AbstractLangTest { /** * Provides a method with a well known chained/nested exception * name which matches the full signature (e.g. has a return value - * of {@code Throwable}. + * of {@code Throwable}). */ private static class ExceptionWithCause extends Exception { private static final long serialVersionUID = 1L; @@ -82,7 +82,7 @@ public class ExceptionUtilsTest extends AbstractLangTest { /** * Provides a method with a well known chained/nested exception * name which does not match the full signature (e.g. lacks a - * return value of {@code Throwable}. + * return value of {@code Throwable}). */ private static class ExceptionWithoutCause extends Exception { private static final long serialVersionUID = 1L; diff --git a/src/test/java/org/apache/commons/lang3/function/Objects.java b/src/test/java/org/apache/commons/lang3/function/Objects.java index b919c7fbb..21e30cd8e 100755 --- a/src/test/java/org/apache/commons/lang3/function/Objects.java +++ b/src/test/java/org/apache/commons/lang3/function/Objects.java @@ -29,13 +29,13 @@ import org.apache.commons.lang3.ObjectUtils; * This class provides some replacements for the corresponding methods in * {@link java.util.Objects}. The replacements have the advantage, that they are properly * annotated with {@link Nullable}, and/or {@link Nonnull}, so they let the - * compiler know, what their respective results are. + * compiler know what their respective results are. * * The various {@code requireNonNull} methods are particularly handy, when * dealing with external code, that a) doesn't support the {@link Nonnull} * annotation, or if you know for other reasons, that an object is non-null. * Take for example, a {@link java.util.Map map}, that you have filled with - * non-null values. So, in your opinion, the following should be perfectably + * non-null values. So, in your opinion, the following should be perfectly * valid code: *

  *   final Map<String,Object> map = getMapOfNonNullValues();
diff --git a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
index 4ff81c70e..d2d3267eb 100644
--- a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
@@ -1576,7 +1576,7 @@ public class NumberUtilsTest extends AbstractLangTest {
     public void testToScaledBigDecimalBigDecimal() {
         assertEquals(NumberUtils.toScaledBigDecimal(BigDecimal.valueOf(123.456)), BigDecimal.valueOf(123.46),
             "toScaledBigDecimal(BigDecimal) 1 failed");
-        // Test RoudingMode.HALF_EVEN default rounding.
+        // Test RoundingMode.HALF_EVEN default rounding.
         assertEquals(NumberUtils.toScaledBigDecimal(BigDecimal.valueOf(23.515)), BigDecimal.valueOf(23.52),
             "toScaledBigDecimal(BigDecimal) 2 failed");
         assertEquals(NumberUtils.toScaledBigDecimal(BigDecimal.valueOf(23.525)), BigDecimal.valueOf(23.52),
@@ -1594,17 +1594,17 @@ public class NumberUtilsTest extends AbstractLangTest {
     @Test
     public void testToScaledBigDecimalBigDecimalIRM() {
         assertEquals(NumberUtils.toScaledBigDecimal(BigDecimal.valueOf(123.456), 1, RoundingMode.CEILING),
-            BigDecimal.valueOf(123.5), "toScaledBigDecimal(BigDecimal, int, RoudingMode) 1 failed");
+            BigDecimal.valueOf(123.5), "toScaledBigDecimal(BigDecimal, int, RoundingMode) 1 failed");
         assertEquals(NumberUtils.toScaledBigDecimal(BigDecimal.valueOf(23.5159), 3, RoundingMode.FLOOR),
-            BigDecimal.valueOf(23.515), "toScaledBigDecimal(BigDecimal, int, RoudingMode) 2 failed");
+            BigDecimal.valueOf(23.515), "toScaledBigDecimal(BigDecimal, int, RoundingMode) 2 failed");
         assertEquals(NumberUtils.toScaledBigDecimal(BigDecimal.valueOf(23.525), 2, RoundingMode.HALF_UP),
-            BigDecimal.valueOf(23.53), "toScaledBigDecimal(BigDecimal, int, RoudingMode) 3 failed");
+            BigDecimal.valueOf(23.53), "toScaledBigDecimal(BigDecimal, int, RoundingMode) 3 failed");
         assertEquals("23521.0000",
             NumberUtils.toScaledBigDecimal(BigDecimal.valueOf(23.521), 4, RoundingMode.HALF_EVEN)
                 .multiply(BigDecimal.valueOf(1000)).toString(),
-            "toScaledBigDecimal(BigDecimal, int, RoudingMode) 4 failed");
+            "toScaledBigDecimal(BigDecimal, int, RoundingMode) 4 failed");
         assertEquals(NumberUtils.toScaledBigDecimal((BigDecimal) null, 2, RoundingMode.HALF_UP), BigDecimal.ZERO,
-            "toScaledBigDecimal(BigDecimal, int, RoudingMode) 5 failed");
+            "toScaledBigDecimal(BigDecimal, int, RoundingMode) 5 failed");
     }
 
     /**
@@ -1614,7 +1614,7 @@ public class NumberUtilsTest extends AbstractLangTest {
     public void testToScaledBigDecimalDouble() {
         assertEquals(NumberUtils.toScaledBigDecimal(Double.valueOf(123.456d)), BigDecimal.valueOf(123.46),
             "toScaledBigDecimal(Double) 1 failed");
-        // Test RoudingMode.HALF_EVEN default rounding.
+        // Test RoundingMode.HALF_EVEN default rounding.
         assertEquals(NumberUtils.toScaledBigDecimal(Double.valueOf(23.515d)), BigDecimal.valueOf(23.52),
             "toScaledBigDecimal(Double) 2 failed");
         assertEquals(NumberUtils.toScaledBigDecimal(Double.valueOf(23.525d)), BigDecimal.valueOf(23.52),
@@ -1632,17 +1632,17 @@ public class NumberUtilsTest extends AbstractLangTest {
     @Test
     public void testToScaledBigDecimalDoubleIRM() {
         assertEquals(NumberUtils.toScaledBigDecimal(Double.valueOf(123.456d), 1, RoundingMode.CEILING),
-            BigDecimal.valueOf(123.5), "toScaledBigDecimal(Double, int, RoudingMode) 1 failed");
+            BigDecimal.valueOf(123.5), "toScaledBigDecimal(Double, int, RoundingMode) 1 failed");
         assertEquals(NumberUtils.toScaledBigDecimal(Double.valueOf(23.5159d), 3, RoundingMode.FLOOR),
-            BigDecimal.valueOf(23.515), "toScaledBigDecimal(Double, int, RoudingMode) 2 failed");
+            BigDecimal.valueOf(23.515), "toScaledBigDecimal(Double, int, RoundingMode) 2 failed");
         assertEquals(NumberUtils.toScaledBigDecimal(Double.valueOf(23.525d), 2, RoundingMode.HALF_UP),
-            BigDecimal.valueOf(23.53), "toScaledBigDecimal(Double, int, RoudingMode) 3 failed");
+            BigDecimal.valueOf(23.53), "toScaledBigDecimal(Double, int, RoundingMode) 3 failed");
         assertEquals("23521.0000",
             NumberUtils.toScaledBigDecimal(Double.valueOf(23.521d), 4, RoundingMode.HALF_EVEN)
                 .multiply(BigDecimal.valueOf(1000)).toString(),
-            "toScaledBigDecimal(Double, int, RoudingMode) 4 failed");
+            "toScaledBigDecimal(Double, int, RoundingMode) 4 failed");
         assertEquals(NumberUtils.toScaledBigDecimal((Double) null, 2, RoundingMode.HALF_UP), BigDecimal.ZERO,
-            "toScaledBigDecimal(Double, int, RoudingMode) 5 failed");
+            "toScaledBigDecimal(Double, int, RoundingMode) 5 failed");
     }
 
     /**
@@ -1652,7 +1652,7 @@ public class NumberUtilsTest extends AbstractLangTest {
     public void testToScaledBigDecimalFloat() {
         assertEquals(NumberUtils.toScaledBigDecimal(Float.valueOf(123.456f)), BigDecimal.valueOf(123.46),
             "toScaledBigDecimal(Float) 1 failed");
-        // Test RoudingMode.HALF_EVEN default rounding.
+        // Test RoundingMode.HALF_EVEN default rounding.
         assertEquals(NumberUtils.toScaledBigDecimal(Float.valueOf(23.515f)), BigDecimal.valueOf(23.51),
             "toScaledBigDecimal(Float) 2 failed");
         // Note. NumberUtils.toScaledBigDecimal(Float.valueOf(23.515f)).equals(BigDecimal.valueOf(23.51))
@@ -1672,16 +1672,16 @@ public class NumberUtilsTest extends AbstractLangTest {
     @Test
     public void testToScaledBigDecimalFloatIRM() {
         assertEquals(NumberUtils.toScaledBigDecimal(Float.valueOf(123.456f), 1, RoundingMode.CEILING),
-            BigDecimal.valueOf(123.5), "toScaledBigDecimal(Float, int, RoudingMode) 1 failed");
+            BigDecimal.valueOf(123.5), "toScaledBigDecimal(Float, int, RoundingMode) 1 failed");
         assertEquals(NumberUtils.toScaledBigDecimal(Float.valueOf(23.5159f), 3, RoundingMode.FLOOR),
-            BigDecimal.valueOf(23.515), "toScaledBigDecimal(Float, int, RoudingMode) 2 failed");
+            BigDecimal.valueOf(23.515), "toScaledBigDecimal(Float, int, RoundingMode) 2 failed");
         // The following happens due to roundoff error. We're ok with this.
         assertEquals(NumberUtils.toScaledBigDecimal(Float.valueOf(23.525f), 2, RoundingMode.HALF_UP),
-            BigDecimal.valueOf(23.52), "toScaledBigDecimal(Float, int, RoudingMode) 3 failed");
+            BigDecimal.valueOf(23.52), "toScaledBigDecimal(Float, int, RoundingMode) 3 failed");
         assertEquals("23521.0000", NumberUtils.toScaledBigDecimal(Float.valueOf(23.521f), 4, RoundingMode.HALF_EVEN)
-            .multiply(BigDecimal.valueOf(1000)).toString(), "toScaledBigDecimal(Float, int, RoudingMode) 4 failed");
+            .multiply(BigDecimal.valueOf(1000)).toString(), "toScaledBigDecimal(Float, int, RoundingMode) 4 failed");
         assertEquals(NumberUtils.toScaledBigDecimal((Float) null, 2, RoundingMode.HALF_UP), BigDecimal.ZERO,
-            "toScaledBigDecimal(Float, int, RoudingMode) 5 failed");
+            "toScaledBigDecimal(Float, int, RoundingMode) 5 failed");
     }
 
     /**
@@ -1691,7 +1691,7 @@ public class NumberUtilsTest extends AbstractLangTest {
     public void testToScaledBigDecimalString() {
         assertEquals(NumberUtils.toScaledBigDecimal("123.456"), BigDecimal.valueOf(123.46),
             "toScaledBigDecimal(String) 1 failed");
-        // Test RoudingMode.HALF_EVEN default rounding.
+        // Test RoundingMode.HALF_EVEN default rounding.
         assertEquals(NumberUtils.toScaledBigDecimal("23.515"), BigDecimal.valueOf(23.52),
             "toScaledBigDecimal(String) 2 failed");
         assertEquals(NumberUtils.toScaledBigDecimal("23.525"), BigDecimal.valueOf(23.52),
@@ -1708,17 +1708,17 @@ public class NumberUtilsTest extends AbstractLangTest {
     @Test
     public void testToScaledBigDecimalStringIRM() {
         assertEquals(NumberUtils.toScaledBigDecimal("123.456", 1, RoundingMode.CEILING), BigDecimal.valueOf(123.5),
-            "toScaledBigDecimal(String, int, RoudingMode) 1 failed");
+            "toScaledBigDecimal(String, int, RoundingMode) 1 failed");
         assertEquals(NumberUtils.toScaledBigDecimal("23.5159", 3, RoundingMode.FLOOR), BigDecimal.valueOf(23.515),
-            "toScaledBigDecimal(String, int, RoudingMode) 2 failed");
+            "toScaledBigDecimal(String, int, RoundingMode) 2 failed");
         assertEquals(NumberUtils.toScaledBigDecimal("23.525", 2, RoundingMode.HALF_UP), BigDecimal.valueOf(23.53),
-            "toScaledBigDecimal(String, int, RoudingMode) 3 failed");
+            "toScaledBigDecimal(String, int, RoundingMode) 3 failed");
         assertEquals(
             "23521.0000", NumberUtils.toScaledBigDecimal("23.521", 4, RoundingMode.HALF_EVEN)
                 .multiply(BigDecimal.valueOf(1000)).toString(),
-            "toScaledBigDecimal(String, int, RoudingMode) 4 failed");
+            "toScaledBigDecimal(String, int, RoundingMode) 4 failed");
         assertEquals(NumberUtils.toScaledBigDecimal((String) null, 2, RoundingMode.HALF_UP), BigDecimal.ZERO,
-            "toScaledBigDecimal(String, int, RoudingMode) 5 failed");
+            "toScaledBigDecimal(String, int, RoundingMode) 5 failed");
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java b/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
index f9f0e4df3..f773b0697 100644
--- a/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
+++ b/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
@@ -203,7 +203,7 @@ public class ExtendedMessageFormatTest extends AbstractLangTest {
 //    }
 
     /**
-     * Test the built in choice format.
+     * Test the built-in choice format.
      */
     @Test
     public void testBuiltInChoiceFormat() {
@@ -223,7 +223,7 @@ public class ExtendedMessageFormatTest extends AbstractLangTest {
     }
 
     /**
-     * Test the built in date/time formats
+     * Test the built-in date/time formats
      */
     @Test
     public void testBuiltInDateTimeFormat() {
@@ -273,7 +273,7 @@ public class ExtendedMessageFormatTest extends AbstractLangTest {
     }
 
     /**
-     * Test the built in number formats.
+     * Test the built-in number formats.
      */
     @Test
     public void testBuiltInNumberFormat() {
@@ -330,7 +330,7 @@ public class ExtendedMessageFormatTest extends AbstractLangTest {
     }
 
     /**
-     * Test a built in format for the specified Locales, plus {@code null} Locale.
+     * Test a built-in format for the specified Locales, plus {@code null} Locale.
      * @param pattern MessageFormat pattern
      * @param args MessageFormat arguments
      * @param locales to test
@@ -340,7 +340,7 @@ public class ExtendedMessageFormatTest extends AbstractLangTest {
     }
 
     /**
-     * Test a built in format for the specified Locales, plus {@code null} Locale.
+     * Test a built-in format for the specified Locales, plus {@code null} Locale.
      * @param pattern MessageFormat pattern
      * @param fmtRegistry FormatFactory registry to use
      * @param args MessageFormat arguments
diff --git a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
index c5d0bee6f..02c4ac677 100644
--- a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
@@ -69,7 +69,7 @@ public class DateUtilsTest extends AbstractLangTest {
         assertWeekIterator(it, start, end);
     }
     /**
-     * This checks that this is a 7 divisble iterator of Calendar objects
+     * This checks that this is a 7 divisible iterator of Calendar objects
      * that are dates (no time), and exactly 1 day spaced after each other
      * (in addition to the proper start and stop dates)
      */
diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
index e1c87ea7f..53cd69d6b 100644
--- a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
@@ -663,10 +663,10 @@ public class FastDateParserTest extends AbstractLangTest {
         testSdfAndFdp(dpProvider, "''''yyyyMMdd'A''B'HHmmssSSS''", "''20030210A'B153320989'", false); // OK
         testSdfAndFdp(dpProvider, "'$\\Ed'", "$\\Ed", false); // OK
 
-        // quoted charaters are case sensitive
+        // quoted characters are case-sensitive
         testSdfAndFdp(dpProvider, "'QED'", "QED", false);
         testSdfAndFdp(dpProvider, "'QED'", "qed", true);
-        // case sensitive after insensitive Month field
+        // case-sensitive after insensitive Month field
         testSdfAndFdp(dpProvider, "yyyy-MM-dd 'QED'", "2003-02-10 QED", false);
         testSdfAndFdp(dpProvider, "yyyy-MM-dd 'QED'", "2003-02-10 qed", true);
     }
@@ -713,7 +713,7 @@ public class FastDateParserTest extends AbstractLangTest {
             sdf.set2DigitYearStart(csDate);
         }
         final String fmt = sdf.format(inDate);
-//        System.out.printf("[Java %s] Date: '%s' formated with '%s' -> '%s'%n", SystemUtils.JAVA_RUNTIME_VERSION, inDate,
+//        System.out.printf("[Java %s] Date: '%s' formatted with '%s' -> '%s'%n", SystemUtils.JAVA_RUNTIME_VERSION, inDate,
 //            formatStr, fmt);
         try {
             final Date out = dateParser.parse(fmt);

From 63cc351c73be29a93c6e5df0cfb0c83cc8a77aae Mon Sep 17 00:00:00 2001
From: Gary Gregory 
Date: Fri, 15 Jul 2022 08:26:42 -0400
Subject: [PATCH 2/2] (doc) Fix typos in javadoc and comments #920

---
 src/changes/changes.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index ccd041850..626f45a7c 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -88,6 +88,7 @@ The  type attribute can be add,update,fix,remove.
     Allow extension of previously final classes ImmutablePair and ImmutableTriple.
     Update ClassUtils Javadoc with some missing throws NPE #912.
     Javadoc: StringUtils.repeat("", "x", 3) = "xx"; #918.
+    (doc) Fix typos in javadoc and comments #920.
     
     Add GitHub coverage.yml.
     Add EnumUtils.getEnumSystemProperty(...).