From f308c41a6413bdabb62ab45e4913becdf10430ea Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 10 Aug 2018 20:02:47 +0300 Subject: [PATCH] Fix coverage --- .../src/main/java/com/annimon/stream/internal/Compose.java | 6 +++--- .../stream/test/hamcrest/OptionalBooleanMatcher.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stream/src/main/java/com/annimon/stream/internal/Compose.java b/stream/src/main/java/com/annimon/stream/internal/Compose.java index fe1bd5f3..d5ae4a59 100644 --- a/stream/src/main/java/com/annimon/stream/internal/Compose.java +++ b/stream/src/main/java/com/annimon/stream/internal/Compose.java @@ -17,7 +17,6 @@ public void run() { b.run(); } catch (Throwable ignore) { } handleException(e1); - return; } b.run(); } @@ -35,7 +34,6 @@ public void run() { b.close(); } catch (Throwable ignore) { } handleException(e1); - return; } try { b.close(); @@ -46,7 +44,9 @@ public void run() { }; } - private static void handleException(Throwable e) { + private static Throwable handleException(Throwable e) { + // Errors and runtime exceptions are thrown as is + // Checked exceptions are wrapped in RuntimeException if (e instanceof RuntimeException) { throw (RuntimeException) e; } else if (e instanceof Error) { diff --git a/streamTest/src/main/java/com/annimon/stream/test/hamcrest/OptionalBooleanMatcher.java b/streamTest/src/main/java/com/annimon/stream/test/hamcrest/OptionalBooleanMatcher.java index c52e5a1a..798ad846 100644 --- a/streamTest/src/main/java/com/annimon/stream/test/hamcrest/OptionalBooleanMatcher.java +++ b/streamTest/src/main/java/com/annimon/stream/test/hamcrest/OptionalBooleanMatcher.java @@ -45,7 +45,7 @@ public static class IsEmptyMatcher extends TypeSafeDiagnosingMatcher