Skip to content
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: RxJavaPlugin.get/setXXX generics? #5045

Closed
davidmoten opened this issue Feb 2, 2017 · 2 comments · Fixed by #5049
Closed

2.x: RxJavaPlugin.get/setXXX generics? #5045

davidmoten opened this issue Feb 2, 2017 · 2 comments · Fixed by #5049

Comments

@davidmoten
Copy link
Collaborator

For unit tests I frequently bump into the restrictiveness of

RxJavaPlugins.setErrorHandler(Consumer<Throwable> handler);

I would like the signature to be

RxJavaPlugins.setErrorHandler(Consumer<? super Throwable> handler);

There are many more methods in RxJavaPlugins that could support lower and upper bounded wildcards. Can I make these changes?

@davidmoten davidmoten changed the title RxJavaPlugin.get/setXXX generics? 2.x: RxJavaPlugin.get/setXXX generics? Feb 2, 2017
@akarnokd
Copy link
Member

akarnokd commented Feb 2, 2017

setErrorHandler: yes, others would bring trouble I think.

@jschneider
Copy link
Contributor

I gave it a shot: #5058
Widening the generics seems to work so far

But of course I don't know about any side effects, possible problems.

akarnokd pushed a commit that referenced this issue Feb 3, 2017
* use bounded wildcards for errorHandler (fixes #5045)

* add test to ensure signature
akarnokd pushed a commit that referenced this issue Feb 6, 2017
* widen bounds

* widen bounds

* add test to ensure generics

* use wildcard import for io.reactivex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants