Skip to content

Cleanup#17801

Merged
jzheaux merged 12 commits intospring-projects:mainfrom
ngocnhan-tran1996:cleanup
Feb 17, 2026
Merged

Cleanup#17801
jzheaux merged 12 commits intospring-projects:mainfrom
ngocnhan-tran1996:cleanup

Conversation

@ngocnhan-tran1996
Copy link
Copy Markdown
Contributor

@ngocnhan-tran1996 ngocnhan-tran1996 commented Aug 24, 2025

This PR includes

  • Use StringUtils#hasLength
  • Remove redundant check and exception
  • Update javadoc
  • Polish some methods

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 24, 2025
* @return
* @param artifactParameterName the artifactParameterName that is removed from the
* current URL. The result becomes the service url. Cannot be null and cannot be an
* empty String.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cannot be null and cannot be an empty String -> Cannot be null or empty String

return role;
}
if (defaultRolePrefix == null || defaultRolePrefix.length() == 0) {
if (defaultRolePrefix == null || defaultRolePrefix.isEmpty()) {
Copy link
Copy Markdown
Contributor

@ronodhirSoumik ronodhirSoumik Aug 26, 2025

Choose a reason for hiding this comment

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

As there are several uses of str == null || str.isEmpty() I think a common util function will be helpful

boolean isEmpty(String str) {
	return str == null || str.length == 0;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we can use !org.springframework.util.StringUtils#hasLength

Copy link
Copy Markdown
Contributor

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

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

Thanks for all the great cleanup, @ngocnhan-tran1996. I've left some feedback inline.

@jzheaux jzheaux self-assigned this Oct 20, 2025
@jzheaux jzheaux added in: core An issue in spring-security-core type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 20, 2025
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit reorders the originally changed boolean logic so that it returns
false early, as it did before. This allows the change to remain small and also
keeps the most complex logical statements outside of the if statement.

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
@jzheaux jzheaux added this to the 7.1.0-M2 milestone Feb 13, 2026
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
@jgrandja jgrandja modified the milestones: 7.1.0-M2, 7.1.0-M3 Feb 13, 2026
@jzheaux jzheaux merged commit da0cd0b into spring-projects:main Feb 17, 2026
7 checks passed
@jzheaux
Copy link
Copy Markdown
Contributor

jzheaux commented Feb 18, 2026

Thanks, @ngocnhan-tran1996! This is now merged into main.

@ngocnhan-tran1996 ngocnhan-tran1996 deleted the cleanup branch February 19, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: core An issue in spring-security-core type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants