junit-team/junit — pull request #982 by pettermahlen (2014-09-04 11:38:19+00:00)
Title: Less restrictive type bounds for ThrowableCauseMatcher

Currently, the ThrowableCauseMatcher factory method enforces the same type restrictions on the current exception and the desired cause - this means that the test case in ThrowableCauseMatcherTest in this pull request doesn't even compile, although it makes sense as code.

This change does a few things:
1. Separate the type bounds on the root exception (T in the class definition) from the type bounds on the cause (none at all in the suggested solution).
1. Clarify that the matcher field is used to match against the cause, not the current exception.
1. Clarify that the type parameter in the factory method is different from the type parameter of the class by changing the name to U.

I'm not sure if it's possible to get better than Matcher, but I think the current implementation is incorrect. I'm also not 100% sure what impact, if any, this change would have on backwards compatibility of the API.