commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r922448 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
Date Fri, 12 Mar 2010 22:59:22 GMT
Author: ggregory
Date: Fri Mar 12 22:59:21 2010
New Revision: 922448

URL: http://svn.apache.org/viewvc?rev=922448&view=rev
Log:
Makes sure "..." is the same all over this method.

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=922448&r1=922447&r2=922448&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Fri
Mar 12 22:59:21 2010
@@ -5524,16 +5524,17 @@ public class StringUtils {
         if ((str.length() - offset) < (maxWidth - 3)) {
             offset = str.length() - (maxWidth - 3);
         }
-        if (offset <= 4) {
-            return str.substring(0, maxWidth - 3) + "...";
+        final String abrevMarker = "...";
+		if (offset <= 4) {
+            return str.substring(0, maxWidth - 3) + abrevMarker;
         }
         if (maxWidth < 7) {
             throw new IllegalArgumentException("Minimum abbreviation width with offset is
7");
         }
         if ((offset + (maxWidth - 3)) < str.length()) {
-            return "..." + abbreviate(str.substring(offset), maxWidth - 3);
+            return abrevMarker + abbreviate(str.substring(offset), maxWidth - 3);
         }
-        return "..." + str.substring(str.length() - (maxWidth - 3));
+        return abrevMarker + str.substring(str.length() - (maxWidth - 3));
     }
     
     /**



Mime
View raw message