-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.x Remove Function from transformer interfaces to allow a single obj… #4672
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1974,7 +1974,12 @@ public final <U> Maybe<U> cast(final Class<? extends U> clazz) { | |
*/ | ||
@SchedulerSupport(SchedulerSupport.NONE) | ||
public final <R> Maybe<R> compose(MaybeTransformer<T, R> transformer) { | ||
return wrap(to(transformer)); | ||
try { | ||
return wrap(transformer.apply(this)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no need to try-catch it if it doesn't declare There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does throw exception see later commit |
||
} catch (Throwable ex) { | ||
Exceptions.throwIfFatal(ex); | ||
throw ExceptionHelper.wrapOrThrow(ex); | ||
} | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? extends
should be removed as covariant return types are usually inconvenience to the consumer.