Polish Assertion

By using the supplier version of Assert.notNull, the
string concatenation is delayed.

Issue gh-3403
This commit is contained in:
Josh Cummings 2021-06-30 10:12:27 -06:00
parent 19aa44af41
commit 81ded2a0e5
No known key found for this signature in database
GPG Key ID: 49EF60DD7FF83443
1 changed files with 2 additions and 1 deletions

View File

@ -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));
}
}