From 2a37866e50d71ddf694f010b6d8d3a907a3ca015 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Wed, 13 Nov 2024 10:30:07 -0500 Subject: [PATCH 1/6] Remove dead in-line comment --- .../java/org/apache/commons/lang3/text/WordUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/text/WordUtils.java b/src/main/java/org/apache/commons/lang3/text/WordUtils.java index 55024d6c534..3010fc37161 100644 --- a/src/main/java/org/apache/commons/lang3/text/WordUtils.java +++ b/src/main/java/org/apache/commons/lang3/text/WordUtils.java @@ -37,7 +37,6 @@ @Deprecated public class WordUtils { - // Capitalizing /** * Capitalizes all the whitespace separated words in a String. * Only the first character of each word is changed. To convert the @@ -273,12 +272,14 @@ public static String initials(final String str, final char... delimiters) { final char ch = str.charAt(i); if (isDelimiter(ch, delimiters)) { lastWasGap = true; - } else if (lastWasGap) { + continue; + } + if (lastWasGap) { buf[count++] = ch; lastWasGap = false; - } else { - continue; // ignore ch } + + // ignore ch } return new String(buf, 0, count); } From 267242edf99bf73cae9dd175f918bb9f5012c63f Mon Sep 17 00:00:00 2001 From: Strange Developer <79030489+mosbat@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:10:24 +0100 Subject: [PATCH 2/6] Removed the if-else and replaced with clearer data flow. (#1311) Co-authored-by: ghost --- src/main/java/org/apache/commons/lang3/text/WordUtils.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/text/WordUtils.java b/src/main/java/org/apache/commons/lang3/text/WordUtils.java index 3010fc37161..c5cbedc0b2e 100644 --- a/src/main/java/org/apache/commons/lang3/text/WordUtils.java +++ b/src/main/java/org/apache/commons/lang3/text/WordUtils.java @@ -272,14 +272,12 @@ public static String initials(final String str, final char... delimiters) { final char ch = str.charAt(i); if (isDelimiter(ch, delimiters)) { lastWasGap = true; - continue; + continue; // ignore ch } if (lastWasGap) { buf[count++] = ch; lastWasGap = false; } - - // ignore ch } return new String(buf, 0, count); } From 94de127ae949cf6d86f121c042a19757c6cdc71e Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 15 Nov 2024 10:05:21 -0500 Subject: [PATCH 3/6] Update pom.xml --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 73db97821e2..d510179564c 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,6 @@ jira https://issues.apache.org/jira/browse/LANG - scm:git:http://gitbox.apache.org/repos/asf/commons-lang.git scm:git:https://gitbox.apache.org/repos/asf/commons-lang.git From 6e990fdbd3b6e0db64f632934e08aafb5aeddebf Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 15 Nov 2024 10:07:24 -0500 Subject: [PATCH 4/6] Javadoc: Use semantic tag instead of style tag --- src/main/java/org/apache/commons/lang3/time/StopWatch.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/time/StopWatch.java b/src/main/java/org/apache/commons/lang3/time/StopWatch.java index fefb1e4f660..819996df26b 100644 --- a/src/main/java/org/apache/commons/lang3/time/StopWatch.java +++ b/src/main/java/org/apache/commons/lang3/time/StopWatch.java @@ -708,7 +708,7 @@ public void suspend() { * Gets a summary of the split time that this StopWatch recorded as a string. * *

- * The format used is ISO 8601-like, [message ]hours:minutes:seconds.milliseconds. + * The format used is ISO 8601-like, [message ]hours:minutes:seconds.milliseconds. *

* * @return the split time as a String @@ -725,7 +725,7 @@ public String toSplitString() { * Gets a summary of the time that this StopWatch recorded as a string. * *

- * The format used is ISO 8601-like, [message ]hours:minutes:seconds.milliseconds. + * The format used is ISO 8601-like, [message ]hours:minutes:seconds.milliseconds. *

* * @return the time as a String From 149650adb8d08cbbba763800a659929b9ca355e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:44:58 -0500 Subject: [PATCH 5/6] Bump github/codeql-action from 3.27.0 to 3.27.4 (#1314) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.0 to 3.27.4. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/662472033e021d55d94146f66f6058822b0b39fd...ea9e4e37992a54ee68a9622e985e60c8e8f12d9f) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 6 +++--- .github/workflows/scorecards-analysis.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 95f30b7f170..7a7369cba86 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -57,7 +57,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # 3.27.0 + uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # 3.27.4 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -68,7 +68,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@662472033e021d55d94146f66f6058822b0b39fd # 3.27.0 + uses: github/codeql-action/autobuild@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # 3.27.4 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -82,4 +82,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # 3.27.0 + uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # 3.27.4 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index b3e2bbcc6ab..8a347ce299d 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -64,6 +64,6 @@ jobs: retention-days: 5 - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # 3.27.0 + uses: github/codeql-action/upload-sarif@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # 3.27.4 with: sarif_file: results.sarif From 2a513149dd92dd8aa57f8fbfae867ca044755565 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 15 Nov 2024 11:32:12 -0500 Subject: [PATCH 6/6] Javadoc: Use semantic tag instead of style tag --- .../org/apache/commons/lang3/ClassUtils.java | 8 +-- .../org/apache/commons/lang3/JavaVersion.java | 4 +- .../commons/lang3/RandomStringUtils.java | 2 +- .../org/apache/commons/lang3/RandomUtils.java | 2 +- .../org/apache/commons/lang3/StringUtils.java | 54 +++++++++---------- .../org/apache/commons/lang3/Strings.java | 4 +- .../org/apache/commons/lang3/SystemUtils.java | 2 +- .../builder/ReflectionToStringBuilder.java | 2 +- .../concurrent/BackgroundInitializer.java | 6 +-- .../lang3/concurrent/BasicThreadFactory.java | 26 ++++----- .../CallableBackgroundInitializer.java | 10 ++-- .../lang3/concurrent/ConcurrentUtils.java | 26 ++++----- .../lang3/concurrent/ConstantInitializer.java | 6 +-- .../lang3/concurrent/LazyInitializer.java | 2 +- .../MultiBackgroundInitializer.java | 8 +-- .../lang3/concurrent/TimedSemaphore.java | 4 +- .../exception/DefaultExceptionContext.java | 4 +- .../lang3/exception/ExceptionContext.java | 4 +- .../lang3/text/ExtendedMessageFormat.java | 8 +-- .../commons/lang3/text/StrSubstitutor.java | 16 +++--- .../commons/lang3/text/package-info.java | 2 +- .../lang3/text/translate/package-info.java | 2 +- .../lang3/time/DurationFormatUtils.java | 8 +-- .../commons/lang3/util/FluentBitSet.java | 14 ++--- 24 files changed, 112 insertions(+), 112 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/ClassUtils.java b/src/main/java/org/apache/commons/lang3/ClassUtils.java index d41fe15a31e..601210da697 100644 --- a/src/main/java/org/apache/commons/lang3/ClassUtils.java +++ b/src/main/java/org/apache/commons/lang3/ClassUtils.java @@ -1576,7 +1576,7 @@ private static boolean useFull(final int runAheadTarget, final int source, final *

* * @param classes the class array to convert, may be null or empty - * @return an array which contains for each given class, the primitive class or null if the original class is not + * @return an array which contains for each given class, the primitive class or null if the original class is not * a wrapper class. {@code null} if null input. Empty array if an empty array passed in. * @see #wrapperToPrimitive(Class) * @since 2.4 @@ -1601,11 +1601,11 @@ public static Class[] wrappersToPrimitives(final Class... classes) { *

* This method is the counter part of {@code primitiveToWrapper()}. If the passed in class is a wrapper class for a * primitive type, this primitive type will be returned (e.g. {@code Integer.TYPE} for {@code Integer.class}). For other - * classes, or if the parameter is null, the return value is null. + * classes, or if the parameter is null, the return value is null. *

* - * @param cls the class to convert, may be null - * @return the corresponding primitive type if {@code cls} is a wrapper class, null otherwise + * @param cls the class to convert, may be null + * @return the corresponding primitive type if {@code cls} is a wrapper class, null otherwise * @see #primitiveToWrapper(Class) * @since 2.4 */ diff --git a/src/main/java/org/apache/commons/lang3/JavaVersion.java b/src/main/java/org/apache/commons/lang3/JavaVersion.java index 48ffb29edd5..dcda2c720e2 100644 --- a/src/main/java/org/apache/commons/lang3/JavaVersion.java +++ b/src/main/java/org/apache/commons/lang3/JavaVersion.java @@ -201,7 +201,7 @@ public enum JavaVersion { * internally. * * @param versionStr the Java version as string - * @return the corresponding enumeration constant or null if the + * @return the corresponding enumeration constant or null if the * version is unknown */ static JavaVersion get(final String versionStr) { @@ -278,7 +278,7 @@ static JavaVersion get(final String versionStr) { * internally. * * @param versionStr the Java version as string - * @return the corresponding enumeration constant or null if the + * @return the corresponding enumeration constant or null if the * version is unknown */ static JavaVersion getJavaVersion(final String versionStr) { diff --git a/src/main/java/org/apache/commons/lang3/RandomStringUtils.java b/src/main/java/org/apache/commons/lang3/RandomStringUtils.java index 07f4706e52e..7a192da39bd 100644 --- a/src/main/java/org/apache/commons/lang3/RandomStringUtils.java +++ b/src/main/java/org/apache/commons/lang3/RandomStringUtils.java @@ -33,7 +33,7 @@ * the algorithms/providers specified in the {@code securerandom.strongAlgorithms} {@link Security} property. *

*

- * Use {@link #insecure()} to get the singleton instance based on {@link ThreadLocalRandom#current()} which is not cryptographically secure. In addition, + * Use {@link #insecure()} to get the singleton instance based on {@link ThreadLocalRandom#current()} which is not cryptographically secure. In addition, * instances do not use a cryptographically random seed unless the {@linkplain System#getProperty system property} {@code java.util.secureRandomSeed} is set to * {@code true}. *

diff --git a/src/main/java/org/apache/commons/lang3/RandomUtils.java b/src/main/java/org/apache/commons/lang3/RandomUtils.java index 7bca017704f..42a9c9fb842 100644 --- a/src/main/java/org/apache/commons/lang3/RandomUtils.java +++ b/src/main/java/org/apache/commons/lang3/RandomUtils.java @@ -36,7 +36,7 @@ * the algorithms/providers specified in the {@code securerandom.strongAlgorithms} {@link Security} property. *

*

- * Use {@link #insecure()} to get the singleton instance based on {@link ThreadLocalRandom#current()} which is not cryptographically secure. In addition, + * Use {@link #insecure()} to get the singleton instance based on {@link ThreadLocalRandom#current()} which is not cryptographically secure. In addition, * instances do not use a cryptographically random seed unless the {@linkplain System#getProperty system property} {@code java.util.secureRandomSeed} is set to * {@code true}. *

diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index 70c26ee315b..ec0cf511987 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -37,57 +37,57 @@ * {@code null} safe. * *
    - *
  • IsEmpty/IsBlank + *
  • IsEmpty/IsBlank * - checks if a String contains text
  • - *
  • Trim/Strip + *
  • Trim/Strip * - removes leading and trailing whitespace
  • - *
  • Equals/Compare + *
  • Equals/Compare * - compares two strings in a null-safe manner
  • - *
  • startsWith + *
  • startsWith * - check if a String starts with a prefix in a null-safe manner
  • - *
  • endsWith + *
  • endsWith * - check if a String ends with a suffix in a null-safe manner
  • - *
  • IndexOf/LastIndexOf/Contains + *
  • IndexOf/LastIndexOf/Contains * - null-safe index-of checks - *
  • IndexOfAny/LastIndexOfAny/IndexOfAnyBut/LastIndexOfAnyBut + *
  • IndexOfAny/LastIndexOfAny/IndexOfAnyBut/LastIndexOfAnyBut * - index-of any of a set of Strings
  • - *
  • ContainsOnly/ContainsNone/ContainsAny + *
  • ContainsOnly/ContainsNone/ContainsAny * - checks if String contains only/none/any of these characters
  • - *
  • Substring/Left/Right/Mid + *
  • Substring/Left/Right/Mid * - null-safe substring extractions
  • - *
  • SubstringBefore/SubstringAfter/SubstringBetween + *
  • SubstringBefore/SubstringAfter/SubstringBetween * - substring extraction relative to other strings
  • - *
  • Split/Join + *
  • Split/Join * - splits a String into an array of substrings and vice versa
  • - *
  • Remove/Delete + *
  • Remove/Delete * - removes part of a String
  • - *
  • Replace/Overlay + *
  • Replace/Overlay * - Searches a String and replaces one String with another
  • - *
  • Chomp/Chop + *
  • Chomp/Chop * - removes the last part of a String
  • - *
  • AppendIfMissing + *
  • AppendIfMissing * - appends a suffix to the end of the String if not present
  • - *
  • PrependIfMissing + *
  • PrependIfMissing * - prepends a prefix to the start of the String if not present
  • - *
  • LeftPad/RightPad/Center/Repeat + *
  • LeftPad/RightPad/Center/Repeat * - pads a String
  • - *
  • UpperCase/LowerCase/SwapCase/Capitalize/Uncapitalize + *
  • UpperCase/LowerCase/SwapCase/Capitalize/Uncapitalize * - changes the case of a String
  • - *
  • CountMatches + *
  • CountMatches * - counts the number of occurrences of one String in another
  • - *
  • IsAlpha/IsNumeric/IsWhitespace/IsAsciiPrintable + *
  • IsAlpha/IsNumeric/IsWhitespace/IsAsciiPrintable * - checks the characters in a String
  • - *
  • DefaultString + *
  • DefaultString * - protects against a null input String
  • - *
  • Rotate + *
  • Rotate * - rotate (circular shift) a String
  • - *
  • Reverse/ReverseDelimited + *
  • Reverse/ReverseDelimited * - reverses a String
  • - *
  • Abbreviate + *
  • Abbreviate * - abbreviates a string using ellipses or another given String
  • - *
  • Difference + *
  • Difference * - compares Strings and reports on their differences
  • - *
  • LevenshteinDistance + *
  • LevenshteinDistance * - the number of changes needed to change one String into another
  • *
* @@ -5418,7 +5418,7 @@ public static String normalizeSpace(final String str) { /** * Finds the n-th index within a CharSequence, handling {@code null}. * This method uses {@link String#indexOf(String)} if possible. - *

Note: The code starts looking for a match at the start of the target, + *

Note: The code starts looking for a match at the start of the target, * incrementing the starting index by one after each successful match * (unless {@code searchStr} is an empty string in which case the position * is never incremented and {@code 0} is returned immediately). diff --git a/src/main/java/org/apache/commons/lang3/Strings.java b/src/main/java/org/apache/commons/lang3/Strings.java index 80e18c55cf4..504de96b1ff 100644 --- a/src/main/java/org/apache/commons/lang3/Strings.java +++ b/src/main/java/org/apache/commons/lang3/Strings.java @@ -263,12 +263,12 @@ public int lastIndexOf(final CharSequence seq, final CharSequence searchSeq, fin } /** - * The Case-Insensitive singleton instance. + * The Case-Insensitive singleton instance. */ public static final Strings CI = new CiStrings(true); /** - * The Case-Snsensitive singleton instance. + * The Case-Snsensitive singleton instance. */ public static final Strings CS = new CsStrings(true); diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java b/src/main/java/org/apache/commons/lang3/SystemUtils.java index bec5a5d4226..55486f1f053 100644 --- a/src/main/java/org/apache/commons/lang3/SystemUtils.java +++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java @@ -1911,7 +1911,7 @@ public class SystemUtils { * Holds a class name, on Windows XP this is {@code sun.awt.windows.WToolkit}. *

*

- * On platforms without a GUI, this value is {@code null}. + * On platforms without a GUI, this value is {@code null}. *

*

* Defaults to {@code null} if the runtime does not have security access to read this property or the property does diff --git a/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java b/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java index b0c38202570..31b1e1f6ef8 100644 --- a/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java +++ b/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java @@ -92,7 +92,7 @@ *

* *

- * Note: the default {@link ToStringStyle} will only do a "shallow" formatting, i.e. composed objects are not + * Note: the default {@link ToStringStyle} will only do a "shallow" formatting, i.e. composed objects are not * further traversed. To get "deep" formatting, use an instance of {@link RecursiveToStringStyle}. *

* diff --git a/src/main/java/org/apache/commons/lang3/concurrent/BackgroundInitializer.java b/src/main/java/org/apache/commons/lang3/concurrent/BackgroundInitializer.java index 613c85fb1e4..4c7191a839f 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/BackgroundInitializer.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/BackgroundInitializer.java @@ -271,7 +271,7 @@ public T get() throws ConcurrentException { /** * Returns the {@link ExecutorService} that is actually used for executing * the background task. This method can be called after {@link #start()} - * (before {@code start()} it returns null). If an external executor + * (before {@code start()} it returns null). If an external executor * was set, this is also the active executor. Otherwise this method returns * the temporary executor that was created by this object. * @@ -392,8 +392,8 @@ public final synchronized void setExternalExecutor( * becomes active and invokes the {@link #initialize()} method in a * background task. A {@link BackgroundInitializer} can be started exactly * once. The return value of this method determines whether the start was - * successful: only the first invocation of this method returns true, - * following invocations will return false. + * successful: only the first invocation of this method returns true, + * following invocations will return false. * * @return a flag whether the initializer could be started successfully */ diff --git a/src/main/java/org/apache/commons/lang3/concurrent/BasicThreadFactory.java b/src/main/java/org/apache/commons/lang3/concurrent/BasicThreadFactory.java index 1ba5d4f9a45..aa0c9e24a5e 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/BasicThreadFactory.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/BasicThreadFactory.java @@ -140,7 +140,7 @@ public BasicThreadFactory build() { /** * Sets the daemon flag for the new {@link BasicThreadFactory}. If this - * flag is set to true the new thread factory will create daemon + * flag is set to true the new thread factory will create daemon * threads. * * @param daemon the value of the daemon flag @@ -155,9 +155,9 @@ public Builder daemon(final boolean daemon) { * Sets the naming pattern to be used by the new {@code * BasicThreadFactory}. * - * @param namingPattern the naming pattern (must not be null) + * @param namingPattern the naming pattern (must not be null) * @return a reference to this {@link Builder} - * @throws NullPointerException if the naming pattern is null + * @throws NullPointerException if the naming pattern is null */ public Builder namingPattern(final String namingPattern) { this.namingPattern = Objects.requireNonNull(namingPattern, "pattern"); @@ -195,9 +195,9 @@ public void reset() { * new {@link BasicThreadFactory}. * * @param exceptionHandler the {@link UncaughtExceptionHandler} (must not be - * null) + * null) * @return a reference to this {@link Builder} - * @throws NullPointerException if the exception handler is null + * @throws NullPointerException if the exception handler is null */ public Builder uncaughtExceptionHandler( final Thread.UncaughtExceptionHandler exceptionHandler) { @@ -210,10 +210,10 @@ public Builder uncaughtExceptionHandler( * BasicThreadFactory}. * * @param factory the wrapped {@link ThreadFactory} (must not be - * null) + * null) * @return a reference to this {@link Builder} * @throws NullPointerException if the passed in {@link ThreadFactory} - * is null + * is null */ public Builder wrappedFactory(final ThreadFactory factory) { this.factory = Objects.requireNonNull(factory, "factory"); @@ -256,9 +256,9 @@ private BasicThreadFactory(final Builder builder) { /** * Gets the daemon flag. This flag determines whether newly created - * threads should be daemon threads. If true, this factory object + * threads should be daemon threads. If true, this factory object * calls {@code setDaemon(true)} on the newly created threads. Result can be - * null if no daemon flag was provided at creation time. + * null if no daemon flag was provided at creation time. * * @return the daemon flag */ @@ -268,7 +268,7 @@ public final Boolean getDaemonFlag() { /** * Gets the naming pattern for naming newly created threads. Result can - * be null if no naming pattern was provided. + * be null if no naming pattern was provided. * * @return the naming pattern */ @@ -278,7 +278,7 @@ public final String getNamingPattern() { /** * Gets the priority of the threads created by this factory. Result can - * be null if no priority was specified. + * be null if no priority was specified. * * @return the priority for newly created threads */ @@ -299,7 +299,7 @@ public long getThreadCount() { /** * Gets the {@link UncaughtExceptionHandler} for the threads created by - * this factory. Result can be null if no handler was provided. + * this factory. Result can be null if no handler was provided. * * @return the {@link UncaughtExceptionHandler} */ @@ -309,7 +309,7 @@ public final Thread.UncaughtExceptionHandler getUncaughtExceptionHandler() { /** * Gets the wrapped {@link ThreadFactory}. This factory is used for - * actually creating threads. This method never returns null. If no + * actually creating threads. This method never returns null. If no * {@link ThreadFactory} was passed when this object was created, a default * thread factory is returned. * diff --git a/src/main/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializer.java b/src/main/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializer.java index ade5533ab87..c856f95e5ea 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializer.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializer.java @@ -72,8 +72,8 @@ public class CallableBackgroundInitializer extends BackgroundInitializer { * Creates a new instance of {@link CallableBackgroundInitializer} and sets * the {@link Callable} to be executed in a background thread. * - * @param call the {@link Callable} (must not be null) - * @throws IllegalArgumentException if the {@link Callable} is null + * @param call the {@link Callable} (must not be null) + * @throws IllegalArgumentException if the {@link Callable} is null */ public CallableBackgroundInitializer(final Callable call) { checkCallable(call); @@ -86,10 +86,10 @@ public CallableBackgroundInitializer(final Callable call) { * thread and the {@link ExecutorService} for managing the background * execution. * - * @param call the {@link Callable} (must not be null) + * @param call the {@link Callable} (must not be null) * @param exec an external {@link ExecutorService} to be used for task * execution - * @throws IllegalArgumentException if the {@link Callable} is null + * @throws IllegalArgumentException if the {@link Callable} is null */ public CallableBackgroundInitializer(final Callable call, final ExecutorService exec) { super(exec); @@ -102,7 +102,7 @@ public CallableBackgroundInitializer(final Callable call, final ExecutorServi * undefined. * * @param callable the object to check - * @throws IllegalArgumentException if the {@link Callable} is null + * @throws IllegalArgumentException if the {@link Callable} is null */ private void checkCallable(final Callable callable) { Objects.requireNonNull(callable, "callable"); diff --git a/src/main/java/org/apache/commons/lang3/concurrent/ConcurrentUtils.java b/src/main/java/org/apache/commons/lang3/concurrent/ConcurrentUtils.java index 7ad31d13ba4..6351726b6f8 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/ConcurrentUtils.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/ConcurrentUtils.java @@ -44,7 +44,7 @@ static final class ConstantFuture implements Future { * Creates a new instance of {@link ConstantFuture} and initializes it * with the constant value. * - * @param value the value (may be null) + * @param value the value (may be null) */ ConstantFuture(final T value) { this.value = value; @@ -52,7 +52,7 @@ static final class ConstantFuture implements Future { /** * {@inheritDoc} The cancel operation is not supported. This - * implementation always returns false. + * implementation always returns false. */ @Override public boolean cancel(final boolean mayInterruptIfRunning) { @@ -77,7 +77,7 @@ public T get(final long timeout, final TimeUnit unit) { } /** - * {@inheritDoc} This implementation always returns false; there + * {@inheritDoc} This implementation always returns false; there * is no background process which could be cancelled. */ @Override @@ -86,7 +86,7 @@ public boolean isCancelled() { } /** - * {@inheritDoc} This implementation always returns true because + * {@inheritDoc} This implementation always returns true because * the constant object managed by this {@link Future} implementation is * always available. */ @@ -136,8 +136,8 @@ public static Future constantFuture(final T value) { * is called. With the resulting object * {@link #putIfAbsent(ConcurrentMap, Object, Object)} is called. This * handles the case that in the meantime another thread has added the key to - * the map. Both the map and the initializer can be null; in this - * case this method simply returns null. + * the map. Both the map and the initializer can be null; in this + * case this method simply returns null. * * @param the type of the keys of the map * @param the type of the values of the map @@ -191,8 +191,8 @@ public static V createIfAbsentUnchecked(final ConcurrentMap map, * necessary. This method performs the following checks on the cause of the * passed in exception: *
    - *
  • If the passed in exception is null or the cause is - * null, this method returns null.
  • + *
  • If the passed in exception is null or the cause is + * null, this method returns null.
  • *
  • If the cause is a runtime exception, it is directly thrown.
  • *
  • If the cause is an error, it is directly thrown, too.
  • *
  • In any other case the cause is a checked exception. The method then @@ -239,7 +239,7 @@ public static ConcurrentRuntimeException extractCauseUnchecked( * exception - which might already cause an unchecked exception or an error * being thrown. If the cause is a checked exception however, it is wrapped * in a {@link ConcurrentException}, which is thrown. If the passed in - * exception is null or has no cause, the method simply returns + * exception is null or has no cause, the method simply returns * without throwing an exception. * * @param ex the exception to be handled @@ -280,8 +280,8 @@ public static void handleCauseUnchecked(final ExecutionException ex) { * Invokes the specified {@link ConcurrentInitializer} and returns the * object produced by the initializer. This method just invokes the {@code * get()} method of the given {@link ConcurrentInitializer}. It is - * null-safe: if the argument is null, result is also - * null. + * null-safe: if the argument is null, result is also + * null. * * @param the type of the object produced by the initializer * @param initializer the {@link ConcurrentInitializer} to be invoked @@ -335,9 +335,9 @@ public static T initializeUnchecked(final ConcurrentInitializer initializ * returns the value which is stored in the map. *

    *

    - * This method is null-safe: It accepts a null map as input + * This method is null-safe: It accepts a null map as input * without throwing an exception. In this case the return value is - * null, too. + * null, too. *

    * * @param the type of the keys of the map diff --git a/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java b/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java index 3d2bdaee265..b797d4b22a9 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java @@ -48,8 +48,8 @@ public class ConstantInitializer implements ConcurrentInitializer { * Creates a new instance of {@link ConstantInitializer} and initializes it * with the object to be managed. The {@code get()} method will always * return the object passed here. This class does not place any restrictions - * on the object. It may be null, then {@code get()} will return - * null, too. + * on the object. It may be null, then {@code get()} will return + * null, too. * * @param obj the object to be managed by this initializer */ @@ -59,7 +59,7 @@ public ConstantInitializer(final T obj) { /** * Compares this object with another one. This implementation returns - * true if and only if the passed in object is an instance of + * true if and only if the passed in object is an instance of * {@link ConstantInitializer} which refers to an object equals to the * object managed by this instance. * diff --git a/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java b/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java index 271a97afbef..3f874b7e235 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java @@ -63,7 +63,7 @@ *

    * If multiple threads call the {@code get()} method when the object has not yet been created, they are blocked until initialization completes. The algorithm * guarantees that only a single instance of the wrapped object class is created, which is passed to all callers. Once initialized, calls to the {@code get()} - * method are pretty fast because no synchronization is needed (only an access to a volatile member field). + * method are pretty fast because no synchronization is needed (only an access to a volatile member field). *

    * * @since 3.0 diff --git a/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java b/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java index b4bf4174074..af08c7daf97 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java @@ -158,7 +158,7 @@ private BackgroundInitializer checkName(final String name) { * Returns the {@link ConcurrentException} object that was thrown by the * {@link BackgroundInitializer} with the given name. If this * initializer did not throw an exception, the return value is - * null. If the name cannot be resolved, an exception is thrown. + * null. If the name cannot be resolved, an exception is thrown. * * @param name the name of the {@link BackgroundInitializer} * @return the exception thrown by this initializer @@ -185,7 +185,7 @@ public BackgroundInitializer getInitializer(final String name) { * Returns the result object produced by the {@code * BackgroundInitializer} with the given name. This is the object * returned by the initializer's {@code initialize()} method. If this - * {@link BackgroundInitializer} caused an exception, null is + * {@link BackgroundInitializer} caused an exception, null is * returned. If the name cannot be resolved, an exception is thrown. * * @param name the name of the {@link BackgroundInitializer} @@ -259,9 +259,9 @@ public MultiBackgroundInitializer(final ExecutorService exec) { * be processed. This method must not be called after {@link #start()} has * been invoked. * - * @param name the name of the initializer (must not be null) + * @param name the name of the initializer (must not be null) * @param backgroundInitializer the {@link BackgroundInitializer} to add (must not be - * null) + * null) * @throws NullPointerException if either {@code name} or {@code backgroundInitializer} * is {@code null} * @throws IllegalStateException if {@code start()} has already been called 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 540c33c4568..e7ba70081d0 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java @@ -200,7 +200,7 @@ public TimedSemaphore(final long timePeriod, final TimeUnit timeUnit, final int * Creates a new instance of {@link TimedSemaphore} and initializes it with * an executor service, the given time period, and the limit. The executor * service will be used for creating a periodic task for monitoring the time - * period. It can be null, then a default service will be created. + * period. It can be null, then a default service will be created. * * @param service the executor service * @param timePeriod the time period @@ -377,7 +377,7 @@ public TimeUnit getUnit() { /** * Tests whether the {@link #shutdown()} method has been called on this - * object. If this method returns true, this instance cannot be used + * object. If this method returns true, this instance cannot be used * any longer. * * @return a flag whether a shutdown has been performed diff --git a/src/main/java/org/apache/commons/lang3/exception/DefaultExceptionContext.java b/src/main/java/org/apache/commons/lang3/exception/DefaultExceptionContext.java index cb9f182fa4c..d727e185a5c 100644 --- a/src/main/java/org/apache/commons/lang3/exception/DefaultExceptionContext.java +++ b/src/main/java/org/apache/commons/lang3/exception/DefaultExceptionContext.java @@ -98,8 +98,8 @@ public Object getFirstContextValue(final String label) { /** * Builds the message containing the contextual information. * - * @param baseMessage the base exception message without context information appended - * @return the exception message with context information appended, never null + * @param baseMessage the base exception message without context information appended + * @return the exception message with context information appended, never null */ @Override public String getFormattedExceptionMessage(final String baseMessage) { diff --git a/src/main/java/org/apache/commons/lang3/exception/ExceptionContext.java b/src/main/java/org/apache/commons/lang3/exception/ExceptionContext.java index 121f8f466a5..6c45612fa6e 100644 --- a/src/main/java/org/apache/commons/lang3/exception/ExceptionContext.java +++ b/src/main/java/org/apache/commons/lang3/exception/ExceptionContext.java @@ -82,8 +82,8 @@ public interface ExceptionContext { * Gets the contextualized error message based on a base message. * This will add the context label-value pairs to the message. * - * @param baseMessage the base exception message without context information appended - * @return the exception message with context information appended, not {@code null} + * @param baseMessage the base exception message without context information appended + * @return the exception message with context information appended, not {@code null} */ String getFormattedExceptionMessage(String baseMessage); diff --git a/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java b/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java index 8fedbe16739..32d73936e03 100644 --- a/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java +++ b/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java @@ -37,9 +37,9 @@ * parsed from the message pattern. In this way custom patterns can be specified, * and the formats supported by {@link java.text.MessageFormat} can be overridden * at the format and/or format style level (see MessageFormat). A "format element" - * embedded in the message pattern is specified (()? signifies optionality):
    - * {argument-number({@code ,}format-name - * ({@code ,}format-style)?)?} + * embedded in the message pattern is specified (()? signifies optionality):
    + * {argument-number({@code ,}format-name + * ({@code ,}format-style)?)?} * *

    * format-name and format-style values are trimmed of surrounding whitespace @@ -50,7 +50,7 @@ * found is used for this format element. *

    * - *

    NOTICE: The various subformat mutator methods are considered unnecessary; they exist on the parent + *

    NOTICE: The various subformat mutator methods are considered unnecessary; they exist on the parent * class to allow the type of customization which it is the job of this class to provide in * a configurable fashion. These methods have thus been disabled and will throw * {@link UnsupportedOperationException} if called. 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 7b97f15a53b..7f85de30fcb 100644 --- a/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java +++ b/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java @@ -134,10 +134,10 @@ * {@link StrSubstitutor} supports this recursive substitution in variable * names, but it has to be enabled explicitly by setting the * {@link #setEnableSubstitutionInVariables(boolean) enableSubstitutionInVariables} - * property to true. + * property to true. *

    *

    - * This class is not thread safe. + * This class is not thread safe. *

    * * @since 2.2 @@ -862,7 +862,7 @@ public boolean replaceIn(final StringBuilder source, final int offset, final int * @param buf the buffer where the substitution is occurring, not null * @param startPos the start position of the variable including the prefix, valid * @param endPos the end position of the variable including the suffix, valid - * @return the variable's value or null if the variable is unknown + * @return the variable's value or null if the variable is unknown */ protected String resolveVariable(final String variableName, final StrBuilder buf, final int startPos, final int endPos) { final StrLookup resolver = getVariableResolver(); @@ -874,9 +874,9 @@ protected String resolveVariable(final String variableName, final StrBuilder buf /** * Sets a flag whether substitution is done in variable names. If set to - * true, the names of variables can contain other variables which are + * true, the names of variables can contain other variables which are * processed first before the original variable is evaluated, e.g. - * {@code ${jre-${java.version}}}. The default value is false. + * {@code ${jre-${java.version}}}. The default value is false. * * @param enableSubstitutionInVariables the new value of the flag * @since 3.0 @@ -899,12 +899,12 @@ public void setEscapeChar(final char escapeCharacter) { /** * Sets a flag controlling whether escapes are preserved during - * substitution. If set to true, the escape character is retained + * substitution. If set to true, the escape character is retained * during substitution (e.g. {@code $${this-is-escaped}} remains - * {@code $${this-is-escaped}}). If set to false, the escape + * {@code $${this-is-escaped}}). If set to false, the escape * character is removed during substitution (e.g. * {@code $${this-is-escaped}} becomes - * {@code ${this-is-escaped}}). The default value is false + * {@code ${this-is-escaped}}). The default value is false * * @param preserveEscapes true if escapes are to be preserved * @since 3.5 diff --git a/src/main/java/org/apache/commons/lang3/text/package-info.java b/src/main/java/org/apache/commons/lang3/text/package-info.java index f0dbe25e7ae..ec44fe5bf46 100644 --- a/src/main/java/org/apache/commons/lang3/text/package-info.java +++ b/src/main/java/org/apache/commons/lang3/text/package-info.java @@ -26,7 +26,7 @@ * ensure we don't clash with any current or future standard Java classes. *

    *

    - * Deprecated As of 3.6, use the Apache Commons Text + * Deprecated As of 3.6, use the Apache Commons Text * text package. *

    * diff --git a/src/main/java/org/apache/commons/lang3/text/translate/package-info.java b/src/main/java/org/apache/commons/lang3/text/translate/package-info.java index 1f959e33fa9..05ce03aa25e 100644 --- a/src/main/java/org/apache/commons/lang3/text/translate/package-info.java +++ b/src/main/java/org/apache/commons/lang3/text/translate/package-info.java @@ -22,7 +22,7 @@ * These classes are immutable, and therefore thread-safe. *

    *

    - * Deprecated As of 3.6, use the Apache Commons Text + * Deprecated As of 3.6, use the Apache Commons Text * translate package. *

    * 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 2c7d0c13448..38ab0ac7238 100644 --- a/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java +++ b/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java @@ -45,7 +45,7 @@ * 'text'arbitrary text content * * - * Note: It's not currently possible to include a single-quote in a format. + * Note: It's not currently possible to include a single-quote in a format. *
    * Token values are printed using decimal digits. * A token character can be repeated to ensure that the field occupies a certain minimum @@ -58,8 +58,8 @@ * Multiple optional blocks can be used to group literals with the desired token. *

    * Notes on Optional Tokens:
    - * Multiple optional tokens without literals can result in impossible to understand output.
    - * Patterns where all tokens are optional can produce empty strings.
    + * Multiple optional tokens without literals can result in impossible to understand output.
    + * Patterns where all tokens are optional can produce empty strings.
    * (See examples below) *

    *
    @@ -74,7 +74,7 @@ * ['{'dd'}']['<'HH'>']['('mm')']{01}<01>(00) * [dHms]111 * - * Note: Optional blocks cannot be nested. + * Note: Optional blocks cannot be nested. * * @since 2.1 */ diff --git a/src/main/java/org/apache/commons/lang3/util/FluentBitSet.java b/src/main/java/org/apache/commons/lang3/util/FluentBitSet.java index 07bf321c1a0..b3ec2eeb16c 100644 --- a/src/main/java/org/apache/commons/lang3/util/FluentBitSet.java +++ b/src/main/java/org/apache/commons/lang3/util/FluentBitSet.java @@ -65,7 +65,7 @@ public FluentBitSet(final int nbits) { } /** - * Performs a logical AND of this target bit set with the argument bit set. This bit set is modified so that each + * Performs a logical AND of this target bit set with the argument bit set. This bit set is modified so that each * bit in it has the value {@code true} if and only if it both initially had the value {@code true} and the * corresponding bit in the bit set argument also had the value {@code true}. * @@ -78,7 +78,7 @@ public FluentBitSet and(final BitSet set) { } /** - * Performs a logical AND of this target bit set with the argument bit set. This bit set is modified so that each + * Performs a logical AND of this target bit set with the argument bit set. This bit set is modified so that each * bit in it has the value {@code true} if and only if it both initially had the value {@code true} and the * corresponding bit in the bit set argument also had the value {@code true}. * @@ -341,7 +341,7 @@ public int nextSetBit(final int fromIndex) { } /** - * Performs a logical OR of this bit set with the bit set argument. This bit set is modified so that a bit in it + * Performs a logical OR of this bit set with the bit set argument. This bit set is modified so that a bit in it * has the value {@code true} if and only if it either already had the value {@code true} or the corresponding bit in * the bit set argument has the value {@code true}. * @@ -354,7 +354,7 @@ public FluentBitSet or(final BitSet set) { } /** - * Performs a logical OR of this bit set with the bit set arguments. This bit set is modified so that a bit in it + * Performs a logical OR of this bit set with the bit set arguments. This bit set is modified so that a bit in it * has the value {@code true} if and only if it either already had the value {@code true} or the corresponding bit in * the bit set argument has the value {@code true}. * @@ -369,7 +369,7 @@ public FluentBitSet or(final FluentBitSet... set) { } /** - * Performs a logical OR of this bit set with the bit set argument. This bit set is modified so that a bit in it + * Performs a logical OR of this bit set with the bit set argument. This bit set is modified so that a bit in it * has the value {@code true} if and only if it either already had the value {@code true} or the corresponding bit in * the bit set argument has the value {@code true}. * @@ -571,7 +571,7 @@ public String toString() { } /** - * Performs a logical XOR of this bit set with the bit set argument. This bit set is modified so that a bit in it + * Performs a logical XOR of this bit set with the bit set argument. This bit set is modified so that a bit in it * has the value {@code true} if and only if one of the following statements holds: *
      *
    • The bit initially has the value {@code true}, and the corresponding bit in the argument has the value @@ -589,7 +589,7 @@ public FluentBitSet xor(final BitSet set) { } /** - * Performs a logical XOR of this bit set with the bit set argument. This bit set is modified so that a bit in it + * Performs a logical XOR of this bit set with the bit set argument. This bit set is modified so that a bit in it * has the value {@code true} if and only if one of the following statements holds: *
        *
      • The bit initially has the value {@code true}, and the corresponding bit in the argument has the value