From 4cfc9687b5a43725a811124f9e152a66e98d0275 Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Tue, 20 Jul 2021 21:29:50 +0200 Subject: [PATCH] Fixes the Javadoc of ClaimAccessor methods for Map/List to match the implementation behavior in case the claims cannot be converted to Map/List. --- .../security/oauth2/core/ClaimAccessor.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/ClaimAccessor.java b/oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/ClaimAccessor.java index f5a7a4c3e09..0c4dcb724da 100644 --- a/oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/ClaimAccessor.java +++ b/oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/ClaimAccessor.java @@ -136,8 +136,9 @@ default URL getClaimAsURL(String claim) { * Returns the claim value as a {@code Map} or {@code null} if it does * not exist or cannot be assigned to a {@code Map}. * @param claim the name of the claim - * @return the claim value or {@code null} if it does not exist or cannot be assigned - * to a {@code Map} + * @return the claim value or {@code null} if it does not exist + * @throws IllegalArgumentException If the claim exists, but cannot be converted to a + * {@code Map} */ @SuppressWarnings("unchecked") default Map getClaimAsMap(String claim) { @@ -159,8 +160,9 @@ default Map getClaimAsMap(String claim) { * Returns the claim value as a {@code List} or {@code null} if it does not * exist or cannot be assigned to a {@code List}. * @param claim the name of the claim - * @return the claim value or {@code null} if it does not exist or cannot be assigned - * to a {@code List} + * @return the claim value or {@code null} if it does not exist + * @throws IllegalArgumentException If the claim exists, but cannot be converted to a + * {@code List} */ @SuppressWarnings("unchecked") default List getClaimAsStringList(String claim) {