Fail MethodFilter.and() immediately when null is passed

This commit is contained in:
Сергей Цыпанов
2020-11-19 17:36:29 +02:00
committed by Juergen Hoeller
parent 135682e073
commit 9ec96f6141

View File

@@ -831,9 +831,11 @@ public abstract class ReflectionUtils {
* <p>If this filter does not match, the next filter will not be applied.
* @param next the next {@code MethodFilter}
* @return a composite {@code MethodFilter}
* @throws IllegalArgumentException if method's argument is {@code null}
* @since 5.3.2
*/
default MethodFilter and(MethodFilter next) {
Assert.notNull(next, "Next MethodFilter must not be null!");
return method -> matches(method) && next.matches(method);
}
}