From 308e408b13763bded9f7fbfe3150501b76501bf9 Mon Sep 17 00:00:00 2001 From: DingHao Date: Thu, 24 Oct 2024 09:58:55 +0800 Subject: [PATCH] Polish DelegatingAuthenticationConverter --- .../web/authentication/DelegatingAuthenticationConverter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/main/java/org/springframework/security/web/authentication/DelegatingAuthenticationConverter.java b/web/src/main/java/org/springframework/security/web/authentication/DelegatingAuthenticationConverter.java index f10e3cffcb3..476c778dff0 100644 --- a/web/src/main/java/org/springframework/security/web/authentication/DelegatingAuthenticationConverter.java +++ b/web/src/main/java/org/springframework/security/web/authentication/DelegatingAuthenticationConverter.java @@ -16,7 +16,6 @@ package org.springframework.security.web.authentication; -import java.util.ArrayList; import java.util.List; import jakarta.servlet.http.HttpServletRequest; @@ -38,7 +37,7 @@ public final class DelegatingAuthenticationConverter implements AuthenticationCo public DelegatingAuthenticationConverter(List delegates) { Assert.notEmpty(delegates, "delegates cannot be null"); - this.delegates = new ArrayList<>(delegates); + this.delegates = List.copyOf(delegates); } public DelegatingAuthenticationConverter(AuthenticationConverter... delegates) {