Merged
Conversation
...org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetails.java
Show resolved
Hide resolved
| * @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. |
Contributor
There was a problem hiding this comment.
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()) { |
Contributor
There was a problem hiding this comment.
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;
}
Contributor
Author
There was a problem hiding this comment.
I think we can use !org.springframework.util.StringUtils#hasLength
ec9b7b9 to
f77e0b9
Compare
jzheaux
requested changes
Oct 20, 2025
Contributor
jzheaux
left a comment
There was a problem hiding this comment.
Thanks for all the great cleanup, @ngocnhan-tran1996. I've left some feedback inline.
...org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetails.java
Outdated
Show resolved
Hide resolved
...org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetails.java
Outdated
Show resolved
Hide resolved
...org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetails.java
Show resolved
Hide resolved
...org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetails.java
Show resolved
Hide resolved
core/src/main/java/org/springframework/security/access/expression/SecurityExpressionRoot.java
Outdated
Show resolved
Hide resolved
...ain/java/org/springframework/security/crypto/password/AbstractValidatingPasswordEncoder.java
Outdated
Show resolved
Hide resolved
...ain/java/org/springframework/security/crypto/password/AbstractValidatingPasswordEncoder.java
Outdated
Show resolved
Hide resolved
web/src/main/java/org/springframework/security/web/firewall/RequestWrapper.java
Outdated
Show resolved
Hide resolved
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>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Contributor
|
Thanks, @ngocnhan-tran1996! This is now merged into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes
StringUtils#hasLength