Isira-Seneviratne commented on a change in pull request #521:
URL: https://github.com/apache/commons-lang/pull/521#discussion_r411417616



##########
File path: src/main/java/org/apache/commons/lang3/StringUtils.java
##########
@@ -330,11 +330,9 @@ public static String abbreviate(final String str, final 
String abbrevMarker, fin
      * @since 3.6
      */
     public static String abbreviate(final String str, final String 
abbrevMarker, int offset, final int maxWidth) {
-        if (isEmpty(str) && isEmpty(abbrevMarker)) {
-            return str;
-        } else if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 
0) {
-            return str.substring(0, maxWidth);
-        } else if (isEmpty(str) || isEmpty(abbrevMarker)) {
+        if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 0) {

Review comment:
       That change would mean that `abbrevMarker` is potentially null.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to