Skip to content

Commit

Permalink
Remove unnecessary processing in ErrorResponse#test(ErrorResponse... (
Browse files Browse the repository at this point in the history
  • Loading branch information
java-coding-prodigy committed May 6, 2022
1 parent b7cfc42 commit 975c470
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -247,8 +247,12 @@ public static Predicate<Throwable> test(@Nonnull Collection<ErrorResponse> respo
{
Checks.noneNull(responses, "ErrorResponse");
EnumSet<ErrorResponse> set = EnumSet.copyOf(responses);
return (error) -> error instanceof ErrorResponseException && set.contains(((ErrorResponseException) error).getErrorResponse());
return test(set);
}

private static Predicate<Throwable> test(@Nonnull EnumSet<ErrorResponse> responses)
{
return error -> error instanceof ErrorResponseException && responses.contains(((ErrorResponseException) error).getErrorResponse());
}

@Nonnull
Expand Down

0 comments on commit 975c470

Please sign in to comment.