Merge branch '3.1.x'
Closes gh-38226
This commit is contained in:
@@ -69,19 +69,20 @@ public class FilterAnnotations implements Iterable<TypeFilter> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private TypeFilter createTypeFilter(FilterType filterType, Class<?> filterClass) {
|
||||
switch (filterType) {
|
||||
case ANNOTATION:
|
||||
return switch (filterType) {
|
||||
case ANNOTATION -> {
|
||||
Assert.isAssignable(Annotation.class, filterClass,
|
||||
"An error occurred while processing an ANNOTATION type filter: ");
|
||||
return new AnnotationTypeFilter((Class<Annotation>) filterClass);
|
||||
case ASSIGNABLE_TYPE:
|
||||
return new AssignableTypeFilter(filterClass);
|
||||
case CUSTOM:
|
||||
yield new AnnotationTypeFilter((Class<Annotation>) filterClass);
|
||||
}
|
||||
case ASSIGNABLE_TYPE -> new AssignableTypeFilter(filterClass);
|
||||
case CUSTOM -> {
|
||||
Assert.isAssignable(TypeFilter.class, filterClass,
|
||||
"An error occurred while processing a CUSTOM type filter: ");
|
||||
return BeanUtils.instantiateClass(filterClass, TypeFilter.class);
|
||||
}
|
||||
throw new IllegalArgumentException("Filter type not supported with Class value: " + filterType);
|
||||
yield BeanUtils.instantiateClass(filterClass, TypeFilter.class);
|
||||
}
|
||||
default -> throw new IllegalArgumentException("Filter type not supported with Class value: " + filterType);
|
||||
};
|
||||
}
|
||||
|
||||
private TypeFilter createTypeFilter(FilterType filterType, String pattern) {
|
||||
|
||||
Reference in New Issue
Block a user