Use switch expressions where appropriate
See gh-31527
This commit is contained in:
committed by
Andy Wilkinson
parent
836b08f49d
commit
458f989cf3
@@ -85,13 +85,12 @@ public class FilterAnnotations implements Iterable<TypeFilter> {
|
||||
}
|
||||
|
||||
private TypeFilter createTypeFilter(FilterType filterType, String pattern) {
|
||||
switch (filterType) {
|
||||
case ASPECTJ:
|
||||
return new AspectJTypeFilter(pattern, this.classLoader);
|
||||
case REGEX:
|
||||
return new RegexPatternTypeFilter(Pattern.compile(pattern));
|
||||
}
|
||||
throw new IllegalArgumentException("Filter type not supported with String pattern: " + filterType);
|
||||
return switch (filterType) {
|
||||
case ASPECTJ -> new AspectJTypeFilter(pattern, this.classLoader);
|
||||
case REGEX -> new RegexPatternTypeFilter(Pattern.compile(pattern));
|
||||
default ->
|
||||
throw new IllegalArgumentException("Filter type not supported with String pattern: " + filterType);
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user