From eb43830260263209ffa9fac55fc5bc579300be9a Mon Sep 17 00:00:00 2001 From: Josh Cummings <3627351+jzheaux@users.noreply.github.com> Date: Mon, 20 Oct 2025 14:21:40 -0600 Subject: [PATCH] Polish JavaDoc 1. Removed comment about not changing field name in a serialized object as this is true for all fields in a Java-serialize POJO 2. Added example value for the constructor that demonstrates the relationship between a role and an authority Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com> --- .../security/core/authority/SimpleGrantedAuthority.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/springframework/security/core/authority/SimpleGrantedAuthority.java b/core/src/main/java/org/springframework/security/core/authority/SimpleGrantedAuthority.java index 96fd186f93..cc918fd70d 100644 --- a/core/src/main/java/org/springframework/security/core/authority/SimpleGrantedAuthority.java +++ b/core/src/main/java/org/springframework/security/core/authority/SimpleGrantedAuthority.java @@ -33,12 +33,12 @@ public final class SimpleGrantedAuthority implements GrantedAuthority { private static final long serialVersionUID = 620L; - // CAUTION renaming to authority will break serialization compatibility private final String role; /** * Constructs a {@code SimpleGrantedAuthority} using the provided authority. - * @param authority The provided authority such as prefixed role + * @param authority The provided authority, including any prefix; for example, + * {@code ROLE_ADMIN} */ public SimpleGrantedAuthority(String authority) { Assert.hasText(authority, "A granted authority textual representation is required");