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-projects-issues opened this issue Dec 11, 2018 · 2 comments
Closed

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

spring-projects-issues opened this issue Dec 11, 2018 · 2 comments
Assignees
Labels
in: core status: declined

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues 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-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 11, 2018

Ankur Pathak commented

Here is my pull request for the issue:

#2048

@spring-projects-issues spring-projects-issues added status: waiting-for-triage type: enhancement in: core and removed type: enhancement labels Jan 11, 2019
@poutsma poutsma self-assigned this Jan 16, 2019
@poutsma
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.

@poutsma poutsma added status: declined and removed status: waiting-for-triage labels Jan 16, 2019
@poutsma poutsma closed this as completed Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: declined
Projects
None yet
Development

No branches or pull requests

2 participants