Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add public EMPTY constant in StringUtils [SPR-17590] #22122

Closed
spring-issuemaster opened this issue Dec 11, 2018 · 2 comments
Assignees

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Dec 11, 2018

Ankur Pathak opened SPR-17590 and commented

All spring projects are using "" as empty string. And "" is scattered at all places in all Spring projects. It would be better to add public constant

EMPTY in StringUtils and use it in all spring projects. 

I will be providing a pull request for this issue.

 


Affects: 5.1.3

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Dec 11, 2018

Ankur Pathak commented

Here is my pull request for the issue:

#2048

@poutsma

This comment has been minimized.

Copy link
Contributor

@poutsma poutsma commented Jan 16, 2019

It would be better to add public constant

While that may be true for String constants in general—to reduce typos, I don't think this holds true for empty strings. I would argue that "" is more readable than EMPTY, and it is 60% shorter to type as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.