File tree 1 file changed +6
-8
lines changed
cucumber-core/src/main/java/io/cucumber/core/runner
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -26,20 +26,18 @@ final class TestAbortedExceptions {
26
26
27
27
static Predicate <Throwable > createIsTestAbortedExceptionPredicate () {
28
28
ClassLoader defaultClassLoader = ClassLoaders .getDefaultClassLoader ();
29
- return Arrays .stream (TEST_ABORTED_EXCEPTIONS )
30
- .flatMap (s -> {
29
+ return throwable -> Arrays .stream (TEST_ABORTED_EXCEPTIONS )
30
+ .anyMatch (s -> {
31
31
try {
32
32
Class <?> aClass = defaultClassLoader .loadClass (s );
33
- return Stream . of ( aClass );
33
+ return aClass . isInstance ( throwable );
34
34
} catch (Throwable t ) {
35
35
rethrowIfUnrecoverable (t );
36
36
log .debug (t ,
37
- () -> "Failed to load class" + s + " : will not be supported for aborted executions." );
37
+ () -> String . format ( "Failed to load class %s : will not be supported for aborted executions." , s ) );
38
38
}
39
- return Stream .empty ();
40
- })
41
- .map (throwable -> (Predicate <Throwable >) throwable ::isInstance )
42
- .reduce (__ -> false , Predicate ::or );
39
+ return false ;
40
+ });
43
41
}
44
42
45
43
private TestAbortedExceptions () {
You can’t perform that action at this time.
0 commit comments