Add assertion check to FieldFilter.and(FieldFilter) method as well

See gh-26121
This commit is contained in:
Juergen Hoeller 2020-11-19 21:05:24 +01:00
parent a0544e78ea
commit a7cce64e5d
1 changed files with 6 additions and 6 deletions

View File

@ -826,16 +826,15 @@ public abstract class ReflectionUtils {
boolean matches(Method method);
/**
* Create a composite filter based on this filter <em>and</em> the provided
* filter.
* Create a composite filter based on this filter <em>and</em> the provided filter.
* <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}
* @throws IllegalArgumentException if the MethodFilter argument is {@code null}
* @since 5.3.2
*/
default MethodFilter and(MethodFilter next) {
Assert.notNull(next, "Next MethodFilter must not be null!");
Assert.notNull(next, "Next MethodFilter must not be null");
return method -> matches(method) && next.matches(method);
}
}
@ -868,14 +867,15 @@ public abstract class ReflectionUtils {
boolean matches(Field field);
/**
* Create a composite filter based on this filter <em>and</em> the provided
* filter.
* Create a composite filter based on this filter <em>and</em> the provided filter.
* <p>If this filter does not match, the next filter will not be applied.
* @param next the next {@code FieldFilter}
* @return a composite {@code FieldFilter}
* @throws IllegalArgumentException if the FieldFilter argument is {@code null}
* @since 5.3.2
*/
default FieldFilter and(FieldFilter next) {
Assert.notNull(next, "Next FieldFilter must not be null");
return field -> matches(field) && next.matches(field);
}
}