Skip to content

Commit ad96359

Browse files
committed
remove scope warnings
1 parent eeb210e commit ad96359

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

hamcrest-core/src/main/java/org/hamcrest/internal/ReflectiveTypeFinder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public Class<?> findExpectedType(Class<?> fromClass) {
5353
* @param method The method to examine.
5454
* @return true if this method references the relevant type
5555
*/
56-
protected boolean canObtainExpectedTypeFrom(Method method) {
56+
private boolean canObtainExpectedTypeFrom(Method method) {
5757
return method.getName().equals(methodName)
5858
&& method.getParameterTypes().length == expectedNumberOfParameters
5959
&& !method.isSynthetic();
@@ -64,7 +64,7 @@ protected boolean canObtainExpectedTypeFrom(Method method) {
6464
* @param method The method from which to extract
6565
* @return The type we're looking for
6666
*/
67-
protected Class<?> expectedTypeFrom(Method method) {
67+
private Class<?> expectedTypeFrom(Method method) {
6868
return method.getParameterTypes()[typedParameter];
6969
}
7070
}

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ public static void assertUnknownTypeSafe(Matcher<?> matcher) {
5656
}
5757
}
5858

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-
6559
public void testIsNullSafe() {
6660
assertNullSafe(createMatcher());
6761
}
@@ -70,6 +64,13 @@ public void testCopesWithUnknownTypes() {
7064
createMatcher().matches(new UnknownType());
7165
}
7266

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")
7374
public static class UnknownType {
7475
}
7576

hamcrest-library/src/test/java/org/hamcrest/beans/SamePropertyValuesAsTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ public int getInt() {
8181
public Value getValue() {
8282
return valueProperty;
8383
}
84+
85+
@Override public String toString() { return "an ExampleBean"; }
8486
}
8587

8688
public static class SubBeanWithNoExtraProperties extends ExampleBean {

0 commit comments

Comments
 (0)