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/17 15:10:12 UTC

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

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

----------------------------------------------------------------
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

[GitHub] [commons-lang] coveralls edited a comment on issue #514: Simplify a null check in the private replaceEach() method of StringUtils.

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on issue #514: Simplify a null check in the private replaceEach() method of StringUtils.
URL: https://github.com/apache/commons-lang/pull/514#issuecomment-615316497
 
 
   
   [![Coverage Status](https://coveralls.io/builds/30165146/badge)](https://coveralls.io/builds/30165146)
   
   Coverage decreased (-0.0003%) to 95.093% when pulling **cae789f87f7c14d6e5290e0cba40755f1374c408 on Isira-Seneviratne:Simplify_null_check_in_replaceEach** into **e9225d05b25122e0914f1c6f200aaf8fe0e6a75c on apache:master**.
   

----------------------------------------------------------------
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

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

Posted by GitBox <gi...@apache.org>.
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

[GitHub] [commons-lang] kinow commented on issue #514: [LANG-1537]: Simplify a null check in the private replaceEach() method of StringUtils.

Posted by GitBox <gi...@apache.org>.
kinow commented on issue #514: [LANG-1537]: Simplify a null check in the private replaceEach() method of StringUtils.
URL: https://github.com/apache/commons-lang/pull/514#issuecomment-615984102
 
 
   Looks like a good idea to use the `isEmpty` method of the same class. Created a placeholder issue in JIRA. Let's see what others think :+1: thanks for all your great work @Isira-Seneviratne 

----------------------------------------------------------------
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

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

Posted by GitBox <gi...@apache.org>.
namannigam 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_r410687269
 
 

 ##########
 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:
   nit: need to format correctly

----------------------------------------------------------------
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

[GitHub] [commons-lang] coveralls commented on issue #514: Simplify a null check in the private replaceEach() method of StringUtils.

Posted by GitBox <gi...@apache.org>.
coveralls commented on issue #514: Simplify a null check in the private replaceEach() method of StringUtils.
URL: https://github.com/apache/commons-lang/pull/514#issuecomment-615316497
 
 
   
   [![Coverage Status](https://coveralls.io/builds/30150220/badge)](https://coveralls.io/builds/30150220)
   
   Coverage decreased (-0.0003%) to 95.093% when pulling **df15b77b771eff90062cbe0082e631acc0616394 on Isira-Seneviratne:Simplify_null_check_in_replaceEach** into **e9225d05b25122e0914f1c6f200aaf8fe0e6a75c on apache:master**.
   

----------------------------------------------------------------
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

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

Posted by GitBox <gi...@apache.org>.
namannigam 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_r410687269
 
 

 ##########
 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:
   nitpick: need to format this line correctly

----------------------------------------------------------------
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

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

Posted by GitBox <gi...@apache.org>.
namannigam 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_r410687269
 
 

 ##########
 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:
   nitpick: need to format correctly

----------------------------------------------------------------
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