You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original issue created by elchin.asgarli on 2011-07-07 at 01:52 PM
Today I looked at the code of Strings.isNullOrEmpty and was really surprised to find out that it does not trim the string before checking its size/emptiness. Can this method be changed or some other method be added that would also call trim() on String before checking its size?
TIA
P.S. calling trim() on String before passing it to isNullOrEmpty won't work, since it can throw NPE if the passed String is null.
The text was updated successfully, but these errors were encountered:
Original issue created by elchin.asgarli on 2011-07-07 at 01:52 PM
Today I looked at the code of Strings.isNullOrEmpty and was really surprised to find out that it does not trim the string before checking its size/emptiness. Can this method be changed or some other method be added that would also call trim() on String before checking its size?
TIA
P.S. calling trim() on String before passing it to isNullOrEmpty won't work, since it can throw NPE if the passed String is null.
The text was updated successfully, but these errors were encountered: