File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
main/java/org/hamcrest/internal
hamcrest-library/src/test/java/org/hamcrest/beans Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public Class<?> findExpectedType(Class<?> fromClass) {
53
53
* @param method The method to examine.
54
54
* @return true if this method references the relevant type
55
55
*/
56
- protected boolean canObtainExpectedTypeFrom (Method method ) {
56
+ private boolean canObtainExpectedTypeFrom (Method method ) {
57
57
return method .getName ().equals (methodName )
58
58
&& method .getParameterTypes ().length == expectedNumberOfParameters
59
59
&& !method .isSynthetic ();
@@ -64,7 +64,7 @@ protected boolean canObtainExpectedTypeFrom(Method method) {
64
64
* @param method The method from which to extract
65
65
* @return The type we're looking for
66
66
*/
67
- protected Class <?> expectedTypeFrom (Method method ) {
67
+ private Class <?> expectedTypeFrom (Method method ) {
68
68
return method .getParameterTypes ()[typedParameter ];
69
69
}
70
70
}
Original file line number Diff line number Diff line change @@ -56,12 +56,6 @@ public static void assertUnknownTypeSafe(Matcher<?> matcher) {
56
56
}
57
57
}
58
58
59
- public static <T > String mismatchDescription (Matcher <? super T > matcher , T arg ) {
60
- Description description = new StringDescription ();
61
- matcher .describeMismatch (arg , description );
62
- return description .toString ().trim ();
63
- }
64
-
65
59
public void testIsNullSafe () {
66
60
assertNullSafe (createMatcher ());
67
61
}
@@ -70,6 +64,13 @@ public void testCopesWithUnknownTypes() {
70
64
createMatcher ().matches (new UnknownType ());
71
65
}
72
66
67
+ private static <T > String mismatchDescription (Matcher <? super T > matcher , T arg ) {
68
+ Description description = new StringDescription ();
69
+ matcher .describeMismatch (arg , description );
70
+ return description .toString ().trim ();
71
+ }
72
+
73
+ @ SuppressWarnings ("WeakerAccess" )
73
74
public static class UnknownType {
74
75
}
75
76
Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ public int getInt() {
81
81
public Value getValue () {
82
82
return valueProperty ;
83
83
}
84
+
85
+ @ Override public String toString () { return "an ExampleBean" ; }
84
86
}
85
87
86
88
public static class SubBeanWithNoExtraProperties extends ExampleBean {
You can’t perform that action at this time.
0 commit comments