1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Update javadoc and apply StringUtils#hasLength

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
Tran Ngoc Nhan
2025-08-27 01:27:24 +07:00
committed by Josh Cummings
parent 4cc5f543ab
commit 9323775c5f
6 changed files with 18 additions and 15 deletions
@@ -31,6 +31,7 @@ import org.jspecify.annotations.Nullable;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.method.AbstractFallbackMethodSecurityMetadataSource;
import org.springframework.util.StringUtils;
/**
* Sources method security metadata from major JSR 250 security annotations.
@@ -108,7 +109,7 @@ public class Jsr250MethodSecurityMetadataSource extends AbstractFallbackMethodSe
if (role == null) {
return role;
}
if (this.defaultRolePrefix == null || this.defaultRolePrefix.isEmpty()) {
if (!StringUtils.hasLength(this.defaultRolePrefix)) {
return role;
}
if (role.startsWith(this.defaultRolePrefix)) {