This is an automated email from the ASF dual-hosted git repository.

garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new a1c12e6d4 Fix two Javadoc errors in StringUtils (#1763)
a1c12e6d4 is described below

commit a1c12e6d4887d66d2112def35d6109905806410d
Author: hunghhdev <[email protected]>
AuthorDate: Fri Jul 31 00:53:32 2026 +0700

    Fix two Javadoc errors in StringUtils (#1763)
    
    * Fix StringUtils.trimAsciiControl Javadoc
    
    * Fix StringUtils.abbreviate Javadoc example for a single-character marker
---
 src/main/java/org/apache/commons/lang3/StringUtils.java   | 15 ++++++++-------
 .../apache/commons/lang3/StringUtilsAbbreviateTest.java   |  1 +
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java 
b/src/main/java/org/apache/commons/lang3/StringUtils.java
index 5b8b03d72..7d40648c0 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -335,7 +335,7 @@ public static String abbreviate(final String str, final 
String abbrevMarker, fin
      * StringUtils.abbreviate("abcdefghijklmno", ",", 2, 10)    = "abcdefghi,"
      * StringUtils.abbreviate("abcdefghijklmno", "::", 4, 10)   = "::efghij::"
      * StringUtils.abbreviate("abcdefghijklmno", "...", 6, 10)  = "...ghij..."
-     * StringUtils.abbreviate("abcdefghijklmno", "…", 6, 10)    = "…ghij…"
+     * StringUtils.abbreviate("abcdefghijklmno", "…", 6, 10)    = "…ghijklmno"
      * StringUtils.abbreviate("abcdefghijklmno", "*", 9, 10)    = "*ghijklmno"
      * StringUtils.abbreviate("abcdefghijklmno", "'", 10, 10)   = "'ghijklmno"
      * StringUtils.abbreviate("abcdefghijklmno", "!", 12, 10)   = "!ghijklmno"
@@ -8845,18 +8845,19 @@ public static String trim(final String str) {
     }
 
     /**
-     * Removes control characters (char &lt;= 31) from both ends of this 
String, handling {@code null} by returning {@code null}.
+     * Removes {@link CharUtils#isAsciiControl(char) ASCII control characters} 
(char &lt;= 31 or char == 127) from both ends of this String, handling
+     * {@code null} by returning {@code null}.
      *
      * <p>
      * To trim your choice of characters, use the {@link #strip(String, 
String)} methods.
      * </p>
      *
      * <pre>{@code
-     * StringUtils.trim(null)          = null
-     * StringUtils.trim("")            = ""
-     * StringUtils.trim("abc\u0000")   = "abc"
-     * StringUtils.trim("abc")         = "abc"
-     * StringUtils.trim(" abc ")       = " abc "
+     * StringUtils.trimAsciiControl(null)          = null
+     * StringUtils.trimAsciiControl("")            = ""
+     * StringUtils.trimAsciiControl("abc\u0000")   = "abc"
+     * StringUtils.trimAsciiControl("abc")         = "abc"
+     * StringUtils.trimAsciiControl(" abc ")       = " abc "
      * }</pre>
      *
      * @param str The String to be trimmed, may be null.
diff --git 
a/src/test/java/org/apache/commons/lang3/StringUtilsAbbreviateTest.java 
b/src/test/java/org/apache/commons/lang3/StringUtilsAbbreviateTest.java
index 55d2f0fa2..9b37cc808 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsAbbreviateTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsAbbreviateTest.java
@@ -154,6 +154,7 @@ void testAbbreviate_StringStringIntInt() {
         assertAbbreviateWithAbbrevMarkerAndOffset("abcdef____", "____", 5, 10);
         assertAbbreviateWithAbbrevMarkerAndOffset("==fghijk==", "==", 5, 10);
         assertAbbreviateWithAbbrevMarkerAndOffset("___ghij___", "___", 6, 10);
+        assertAbbreviateWithAbbrevMarkerAndOffset("…ghijklmno", "…", 6, 10);
         assertAbbreviateWithAbbrevMarkerAndOffset("/ghijklmno", "/", 7, 10);
         assertAbbreviateWithAbbrevMarkerAndOffset("/ghijklmno", "/", 8, 10);
         assertAbbreviateWithAbbrevMarkerAndOffset("/ghijklmno", "/", 9, 10);

Reply via email to