From ed0265bf024c98943bbcf28ec1ca635d808a2137 Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Tue, 26 Nov 2024 00:41:33 +0700 Subject: [PATCH] Polish Closes gh-1842 --- .../server/authorization/JdbcOAuth2AuthorizationService.java | 3 +-- .../authentication/OAuth2ClientAuthenticationToken.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationService.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationService.java index 32f9bfe1..86af06b0 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationService.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationService.java @@ -766,8 +766,7 @@ public class JdbcOAuth2AuthorizationService implements OAuth2AuthorizationServic @Override protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException { - if (argValue instanceof SqlParameterValue) { - SqlParameterValue paramValue = (SqlParameterValue) argValue; + if (argValue instanceof SqlParameterValue paramValue) { if (paramValue.getSqlType() == Types.BLOB) { if (paramValue.getValue() != null) { Assert.isInstanceOf(byte[].class, paramValue.getValue(), diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientAuthenticationToken.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientAuthenticationToken.java index 7a5c7e7d..a6965109 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientAuthenticationToken.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientAuthenticationToken.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,7 +92,7 @@ public class OAuth2ClientAuthenticationToken extends AbstractAuthenticationToken this.registeredClient = registeredClient; this.clientAuthenticationMethod = clientAuthenticationMethod; this.credentials = credentials; - this.additionalParameters = Collections.unmodifiableMap(Collections.emptyMap()); + this.additionalParameters = Collections.emptyMap(); setAuthenticated(true); }