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

Fix type signature of ExpectedException#except() #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

UrsMetz
Copy link

@UrsMetz UrsMetz commented Sep 10, 2015

This fixes #12 but in contrast to the proposed solution there it changes the signature of ExpectedException#except(Matcher<?>) to expect(Matcher<? super Throwable>).

Following the PECS guideline expect() should take Matcher<? super
Throwable>.

One test had to be adjusted so that the code still compiles:
any(Expection.class) was replaced by instanceOf(Expection.class).
Judging from the JavaDoc of both matchers the latter is anyway the
better fitting one.
* use Java 7's diamond operator
* harmonize generics
* remove unused "generics handling" code
@UrsMetz UrsMetz mentioned this pull request Sep 10, 2015
@kcooney
Copy link

kcooney commented Dec 2, 2016

As a maintainer of JUnit, I support this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ExpectedException#expect() should take Matcher<? extends Throwable> as its argument
2 participants