You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/04/18 12:06:16 UTC

[GitHub] [commons-lang] Isira-Seneviratne commented on a change in pull request #514: Simplify a null check in the private replaceEach() method of StringUtils.

Isira-Seneviratne commented on a change in pull request #514: Simplify a null check in the private replaceEach() method of StringUtils.
URL: https://github.com/apache/commons-lang/pull/514#discussion_r410689369
 
 

 ##########
 File path: src/main/java/org/apache/commons/lang3/StringUtils.java
 ##########
 @@ -6723,8 +6723,7 @@ private static String replaceEach(
         // index of replace array that will replace the search string found
         // NOTE: logic duplicated below START
         for (int i = 0; i < searchLength; i++) {
-            if (noMoreMatchesForReplIndex[i] || searchList[i] == null ||
-                    searchList[i].isEmpty() || replacementList[i] == null) {
+            if (noMoreMatchesForReplIndex[i] || isEmpty(searchList[i])|| replacementList[i] == null) {
 
 Review comment:
   I missed that, thanks!

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services