Skip to content

Commit 8daec02

Browse files
committed
Fixed type finding
1 parent 635a412 commit 8daec02

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎hamcrest-core/src/main/java/org/hamcrest/FunctionMatcher.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static interface Feature<T, U> {
1616
}
1717

1818

19-
private static final ReflectiveTypeFinder TYPE_FINDER = new ReflectiveTypeFinder("featureValueOf", 1, 0);
19+
private static final ReflectiveTypeFinder TYPE_FINDER = new ReflectiveTypeFinder("from", 1, 0);
2020
private final Matcher<? super U> subMatcher;
2121
private final String featureDescription;
2222
private final String featureName;
@@ -32,7 +32,7 @@ public static interface Feature<T, U> {
3232
public FunctionMatcher(String featureDescription, String featureName,
3333
Matcher<? super U> subMatcher,
3434
Feature<T, U> feature) {
35-
super(TYPE_FINDER);
35+
super(TYPE_FINDER.findExpectedType(feature.getClass()));
3636
this.subMatcher = subMatcher;
3737
this.featureDescription = featureDescription;
3838
this.featureName = featureName;

‎hamcrest-core/src/test/java/org/hamcrest/AbstractMatcherTest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static void assertNullSafe(Matcher<?> matcher) {
4646
matcher.matches(null);
4747
}
4848
catch (Exception e) {
49-
Assert.fail("Matcher was not null safe");
49+
Assert.fail("Matcher was not null safe" + e.getMessage());
5050
}
5151
}
5252

@@ -55,7 +55,7 @@ public static void assertUnknownTypeSafe(Matcher<?> matcher) {
5555
matcher.matches(new UnknownType());
5656
}
5757
catch (Exception e) {
58-
Assert.fail("Matcher was not unknown type safe");
58+
Assert.fail("Matcher was not unknown type safe: " + e.getMessage());
5959
}
6060
}
6161

0 commit comments

Comments
 (0)