Avoid String allocations with Assert.notNull()

This commit is contained in:
Sam Brannen
2022-11-08 14:23:22 +01:00
parent 9e4cddf5db
commit 9d73f81e9c
5 changed files with 8 additions and 8 deletions

View File

@@ -155,7 +155,7 @@ public class DynamicClassLoader extends ClassLoader {
private static Method lookupMethod(Class<?> target, String name, Class<?>... parameterTypes) {
Method method = ReflectionUtils.findMethod(target, name, parameterTypes);
Assert.notNull(method, "Expected method '" + name + "' on '" + target.getName());
Assert.notNull(method, () -> "Could not find method '%s' on '%s'".formatted(name, target.getName()));
return method;
}