Skip to content

Commit

Permalink
Polish DelegatingAuthenticationConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
kse-music committed Oct 21, 2024
1 parent a6ee985 commit f7637ad
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package org.springframework.security.web.authentication;

import java.util.ArrayList;
import java.util.List;

import jakarta.servlet.http.HttpServletRequest;
Expand All @@ -38,12 +37,11 @@ public final class DelegatingAuthenticationConverter implements AuthenticationCo

public DelegatingAuthenticationConverter(List<AuthenticationConverter> delegates) {
Assert.notEmpty(delegates, "delegates cannot be null");
this.delegates = new ArrayList<>(delegates);
this.delegates = List.copyOf(delegates);
}

public DelegatingAuthenticationConverter(AuthenticationConverter... delegates) {
Assert.notEmpty(delegates, "delegates cannot be null");
this.delegates = List.of(delegates);
this(List.of(delegates));
}

@Override
Expand Down

0 comments on commit f7637ad

Please sign in to comment.