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 2021/02/19 20:10:44 UTC

[GitHub] [commons-lang] esend7881 opened a new pull request #713: Let left(null) and right(null) return empty

esend7881 opened a new pull request #713:
URL: https://github.com/apache/commons-lang/pull/713


   I'm not sure if there is reasoning behind `left(null, n)` returning null, but other `StringUtils` functions tends to return empty strings if their inputs are null. Likewise, I think it makes sense that `left(null, n)` or `right(null, n)` returns an empty string instead of returning null. My use case is lambda logging. I have code like this:
   
   ```.java
   log.debug("My output (first 256 chars): {}", StringUtils.left(output, 256)::toString);
   ```
   
   I get an NullPointerExceptions when I do and not properly wrap the call, etc. So I can't take advantage of both the `left` function as well as lambda based logging.


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



[GitHub] [commons-lang] garydgregory commented on pull request #713: Let mid(null), left(null) and right(null) return empty

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #713:
URL: https://github.com/apache/commons-lang/pull/713#issuecomment-784256584


   Not sure about the impact here of changing the behavior... needs a bit more study...


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



[GitHub] [commons-lang] coveralls edited a comment on pull request #713: Let mid(null), left(null) and right(null) return empty

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #713:
URL: https://github.com/apache/commons-lang/pull/713#issuecomment-782338572


   
   [![Coverage Status](https://coveralls.io/builds/37285941/badge)](https://coveralls.io/builds/37285941)
   
   Coverage decreased (-0.002%) to 94.955% when pulling **821a4a5b04f6fb4bbdcec014be48bf42df5f48ca on esend7881:patch-1** into **5689c91cf2a3a27f0a3a8a362857f2cf0919d4f6 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



[GitHub] [commons-lang] coveralls commented on pull request #713: Let mid(null), left(null) and right(null) return empty

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #713:
URL: https://github.com/apache/commons-lang/pull/713#issuecomment-782338572


   
   [![Coverage Status](https://coveralls.io/builds/37285868/badge)](https://coveralls.io/builds/37285868)
   
   Coverage decreased (-0.002%) to 94.955% when pulling **821a4a5b04f6fb4bbdcec014be48bf42df5f48ca on esend7881:patch-1** into **5689c91cf2a3a27f0a3a8a362857f2cf0919d4f6 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



[GitHub] [commons-lang] esend7881 commented on pull request #713: Let mid(null), left(null) and right(null) return empty

Posted by GitBox <gi...@apache.org>.
esend7881 commented on pull request #713:
URL: https://github.com/apache/commons-lang/pull/713#issuecomment-782399998


   > 
   > [![Coverage Status](https://coveralls.io/builds/37285941/badge)](https://coveralls.io/builds/37285941)
   > 
   > Coverage decreased (-0.002%) to 94.955% when pulling **821a4a5b04f6fb4bbdcec014be48bf42df5f48ca on esend7881:patch-1** into **5689c91cf2a3a27f0a3a8a362857f2cf0919d4f6 on apache:master**.
   > 
   
   I think that is because the total number of lines have been reduced (smaller denominator) which makes it seem like there is less coverage.


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