From 9ec96f6141a35f6615c5bc68bceac3facd44e8ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=A6=D1=8B=D0=BF?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Thu, 19 Nov 2020 17:36:29 +0200 Subject: [PATCH] Fail MethodFilter.and() immediately when null is passed --- .../src/main/java/org/springframework/util/ReflectionUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java index e00fef835c..8cd1b54202 100644 --- a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java +++ b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java @@ -831,9 +831,11 @@ public abstract class ReflectionUtils { *

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