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


Reply via email to