mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Match if empty by default in InstanceFilter and ExceptionTypeFilter
Prior to this commit, the constructors for InstanceFilter and ExceptionTypeFilter required one to supply the matchIfEmpty flag. However, users will typically want that to be true. Moreover, we always supply true for the matchIfEmpty flag within the Spring Framework. This commit therefore makes the matchIfEmpty flag optional by introducing overloaded constructors for InstanceFilter and ExceptionTypeFilter that only accept the includes and excludes collections. In addition, this commit overhauls the Javadoc for InstanceFilter and ExceptionTypeFilter, fixing several issues in the documentation. Furthermore, this commit applies consistent @Nullable declarations in ExceptionTypeFilter. Closes gh-35158
This commit is contained in:
+1
-1
@@ -64,7 +64,7 @@ public record MethodRetrySpec(
|
||||
|
||||
|
||||
MethodRetryPredicate combinedPredicate() {
|
||||
ExceptionTypeFilter exceptionFilter = new ExceptionTypeFilter(this.includes, this.excludes, true);
|
||||
ExceptionTypeFilter exceptionFilter = new ExceptionTypeFilter(this.includes, this.excludes);
|
||||
return (method, throwable) -> exceptionFilter.match(throwable.getClass()) &&
|
||||
this.predicate.shouldRetry(method, throwable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user