Polish Format

Issue gh-13079
This commit is contained in:
Josh Cummings 2023-04-24 12:52:26 -06:00
parent 73a543d318
commit 599ed3e96b
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
2 changed files with 3 additions and 2 deletions

View File

@ -130,8 +130,8 @@ public final class AuthorityAuthorizationManager<T> implements AuthorizationMana
String[] result = new String[roles.length];
for (int i = 0; i < roles.length; i++) {
String role = roles[i];
Assert.isTrue(rolePrefix.isEmpty() || !role.startsWith(rolePrefix), () -> role + " should not start with " + rolePrefix + " since "
+ rolePrefix
Assert.isTrue(rolePrefix.isEmpty() || !role.startsWith(rolePrefix), () -> role + " should not start with "
+ rolePrefix + " since " + rolePrefix
+ " is automatically prepended when using hasAnyRole. Consider using hasAnyAuthority instead.");
result[i] = rolePrefix + role;
}

View File

@ -271,4 +271,5 @@ public class AuthorityAuthorizationManagerTests {
void hasAnyRoleWhenEmptyRolePrefixThenNoException() {
AuthorityAuthorizationManager.hasAnyRole("", new String[] { "USER" });
}
}