Skip to content

Consistently use CharSequence.isEmpty() for emptiness checks #33577

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

Closed
wants to merge 2 commits into from
Closed

Consistently use CharSequence.isEmpty() for emptiness checks #33577

wants to merge 2 commits into from

Conversation

ngocnhan-tran1996
Copy link
Contributor

No description provided.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 21, 2024
@sbrannen sbrannen changed the title Use isEmpty() for String type instead Consistently use String.isEmpty() for String length checks Sep 23, 2024
@@ -117,7 +117,7 @@ public int getStepArgument(final int index) {
* @return the corresponding TypePath object, or {@literal null} if the path is empty.
*/
public static TypePath fromString(final String typePath) {
if (typePath == null || typePath.length() == 0) {
if (typePath == null || typePath.isEmpty()) {
Copy link
Member

@sbrannen sbrannen Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refrain from modifying classes under org.springframework.asm and org.springframework.objenesis. Those include repackaged forks of the third-party libraries ASM and Objenesis. Any refactoring to those classes should take place upstream in the originating repository. The Spring Framework will then pick up the changes when syncing with official updates of the forked third-party libraries.


Note, however, that we can revert this change manually if we decide to merge this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I should revert files in org.springframework.asm and org.springframework.objenesis to prevent any unexpected exception related third-party

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 23, 2024
@sbrannen sbrannen added this to the 6.2.0-RC2 milestone Sep 23, 2024
@sbrannen sbrannen self-assigned this Sep 23, 2024
@sbrannen sbrannen changed the title Consistently use String.isEmpty() for String length checks Consistently use CharSequence.isEmpty() for emptiness checks Sep 23, 2024
@sbrannen sbrannen closed this in c85050e Sep 23, 2024
@sbrannen
Copy link
Member

This has been merged into main in c85050e.

Thanks

p.s. please note that I updated the copyright dates accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants