Skip to content

Commit

Permalink
Fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
aNNiMON committed Aug 10, 2018
1 parent 12ba844 commit f308c41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions stream/src/main/java/com/annimon/stream/internal/Compose.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public void run() {
b.run();
} catch (Throwable ignore) { }
handleException(e1);
return;
}
b.run();
}
Expand All @@ -35,7 +34,6 @@ public void run() {
b.close();
} catch (Throwable ignore) { }
handleException(e1);
return;
}
try {
b.close();
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static class IsEmptyMatcher extends TypeSafeDiagnosingMatcher<OptionalBoo
@Override
protected boolean matchesSafely(OptionalBoolean optional, Description mismatchDescription) {
mismatchDescription.appendText("OptionalBoolean was present");
return !optional.isPresent();
return optional.isEmpty();
}

@Override
Expand Down

0 comments on commit f308c41

Please sign in to comment.