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

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

commit 0003547994c680d80f31923f8fb50cc300b171c0
Author: Gary D. Gregory <[email protected]>
AuthorDate: Sun Jun 22 08:11:23 2025 -0400

    Extract duplicate magic strings into a private constant and explain its
    content
---
 src/main/java/org/apache/commons/lang3/StringUtils.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java 
b/src/main/java/org/apache/commons/lang3/StringUtils.java
index ab35a44c7..391335062 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -140,6 +140,11 @@ public class StringUtils {
     // String.concat about twice as fast as StringBuffer.append
     // (not sure who tested this)
 
+    /**
+     * This is a 3 character version of an ellipsis. There is a Unicode 
character for a HORIZONTAL ELLIPSIS, U+2026 … this isn't it.
+     */
+    private static final String ELLIPSIS3 = "...";
+
     /**
      * A String for a space character.
      *
@@ -224,7 +229,7 @@ public class StringUtils {
      * @since 2.0
      */
     public static String abbreviate(final String str, final int maxWidth) {
-        return abbreviate(str, "...", 0, maxWidth);
+        return abbreviate(str, ELLIPSIS3, 0, maxWidth);
     }
 
     /**
@@ -263,7 +268,7 @@ public static String abbreviate(final String str, final int 
maxWidth) {
      * @since 2.0
      */
     public static String abbreviate(final String str, final int offset, final 
int maxWidth) {
-        return abbreviate(str, "...", offset, maxWidth);
+        return abbreviate(str, ELLIPSIS3, offset, maxWidth);
     }
 
     /**

Reply via email to