ppkarwasz commented on PR #713:
URL: https://github.com/apache/commons-lang/pull/713#issuecomment-2513568356

   > We are not consistent in `StringUtils`, some methods return `null` on 
`null` input, others return an empty string. Changing this would likely lead to 
unexpected results for call sites in apps and other libraries. If we change 
anything, we should do so consistently in the whole class. At least the 
Javadocs say what to expect. We should probably do this for 4.0 IMO.
   
   Personally I don't like method that return `null` on `null` input. Among the 
nullness checkers I know, only the Checker Framework supports this behavior 
with the [`@PolyNull` 
annotation](https://checkerframework.org/manual/#nullness-annotations).
   
   The "polynull" pattern has also the tendency to contaminate your code: you 
write a lot of "polynull" methods, so that you can compose those methods. You 
could save many LoCs by just checking for `null` once a having methods that 
don't return `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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to