From 81ded2a0e59d8e6b34434a169745fffc43db4f73 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Wed, 30 Jun 2021 10:12:27 -0600 Subject: [PATCH] Polish Assertion By using the supplier version of Assert.notNull, the string concatenation is delayed. Issue gh-3403 --- .../security/provisioning/InMemoryUserDetailsManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/springframework/security/provisioning/InMemoryUserDetailsManager.java b/core/src/main/java/org/springframework/security/provisioning/InMemoryUserDetailsManager.java index 72427296d7..c613035a05 100644 --- a/core/src/main/java/org/springframework/security/provisioning/InMemoryUserDetailsManager.java +++ b/core/src/main/java/org/springframework/security/provisioning/InMemoryUserDetailsManager.java @@ -79,7 +79,8 @@ public class InMemoryUserDetailsManager implements UserDetailsManager, UserDetai String name = (String) names.nextElement(); editor.setAsText(users.getProperty(name)); UserAttribute attr = (UserAttribute) editor.getValue(); - Assert.notNull(attr, "The entry with username '" + name + "' could not be converted to an UserDetails"); + Assert.notNull(attr, + () -> "The entry with username '" + name + "' could not be converted to an UserDetails"); createUser(createUserDetails(name, attr)); } }