From: SourceForge.net <no...@so...> - 2008-08-19 19:58:03
|
Bugs item #1783768, was opened at 2007-08-29 01:25 Message generated for change (Settings changed) made by dsaff You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115278&aid=1783768&group_id=15278 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: framework Group: None Status: Open Resolution: None >Priority: 9 Private: No Submitted By: Shinobu Kawai (shinobukawai) Assigned to: Nobody/Anonymous (nobody) Summary: assertThat signature does not match Matcher Initial Comment: assertThat signature does not match Matcher. Assert: public static <T> void assertThat(T actual, Matcher<T> matcher) Matcher<T>: boolean matches(Object item) assertThat is typed with T, forcing the actual object to be the exact type as the Matcher. However, the Matcher is not necessarily expecting T, but an Object. A wildcard is sufficient, and will prevent compile issues like the one stated in [1779505] assertThat fails with Class tests (the cast-to-Object work around). Attached is a patch to change assertThat to a wildcard, and a test for it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115278&aid=1783768&group_id=15278 |