Skip to content

Commit 6a94a29

Browse files
big-cirjzheaux
authored andcommitted
Lazily compose debug message in AbstractUserDetailsAuthenticationProvider
Closes gh-16495 Signed-off-by: dae won <eodnjs01477@gmail.com>
1 parent 61d92e9 commit 6a94a29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/java/org/springframework/security/authentication/dao/AbstractUserDetailsAuthenticationProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.springframework.context.MessageSource;
2424
import org.springframework.context.MessageSourceAware;
2525
import org.springframework.context.support.MessageSourceAccessor;
26+
import org.springframework.core.log.LogMessage;
2627
import org.springframework.security.authentication.AccountExpiredException;
2728
import org.springframework.security.authentication.AuthenticationProvider;
2829
import org.springframework.security.authentication.BadCredentialsException;
@@ -133,7 +134,7 @@ public Authentication authenticate(Authentication authentication) throws Authent
133134
user = retrieveUser(username, (UsernamePasswordAuthenticationToken) authentication);
134135
}
135136
catch (UsernameNotFoundException ex) {
136-
this.logger.debug("Failed to find user '" + username + "'");
137+
this.logger.debug(LogMessage.format("Failed to find user '%s'", username));
137138
if (!this.hideUserNotFoundExceptions) {
138139
throw ex;
139140
}

0 commit comments

Comments
 (0)