Skip to content

Use String#isEmpty where feasible #32377

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

Conversation

alidandach
Copy link
Contributor

@alidandach alidandach commented Mar 5, 2024

This PR replaces checks for empty strings ("".equals(...)) with the String#isEmpty method.

This change not only improves readability but also aligns with best practices in Java for string emptiness checking.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 5, 2024
@sbrannen sbrannen self-assigned this Mar 5, 2024
@sbrannen sbrannen added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Mar 5, 2024
@sbrannen sbrannen added this to the 6.2.0-M1 milestone Mar 5, 2024
@sbrannen sbrannen changed the title Refactor String Handling Use String#isEmpty where feasible Mar 5, 2024
@sbrannen
Copy link
Member

sbrannen commented Mar 5, 2024

Thanks for the PR, @alidandach.

We don't normally modify classes in our CGLIB fork; however, we'll make an exception to the rule in this case since the proposed changes align with idiomatic Java and potentially result in a performance improvement (albeit negligible).

@sbrannen sbrannen closed this in eb01cc0 Mar 5, 2024
@alidandach alidandach deleted the enhancement/string_handling branch March 14, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants