Skip to content

Commit dda4713

Browse files
committed
Reverted merging of API sources for now. Some warning tidy-up.
1 parent f601123 commit dda4713

File tree

12 files changed

+15
-9
lines changed

12 files changed

+15
-9
lines changed

hamcrest-api/src/main/java/org/hamcrest/Description.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public Description appendValue(Object value) {
6969
return this;
7070
}
7171

72-
@Override
73-
public <T> Description appendValueList(String start, String separator,
72+
@Override @SafeVarargs
73+
public final <T> Description appendValueList(String start, String separator,
7474
String end, T... values) {
7575
return this;
7676
}

hamcrest-core/src/main/java/org/hamcrest/core/Is.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void describeMismatch(Object item, Description mismatchDescription) {
4646
*
4747
*/
4848
public static <T> Matcher<T> is(Matcher<T> matcher) {
49-
return new Is<T>(matcher);
49+
return new Is<>(matcher);
5050
}
5151

5252
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void testCopesWithUnknownTypes() {
7373
assertUnknownTypeSafe(createMatcher());
7474
}
7575

76-
public static class UnknownType {
76+
private static class UnknownType {
7777
}
7878

7979
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public String getResult() {
5252
}
5353
}
5454

55-
public static class ShouldNotMatch {
55+
private static class ShouldNotMatch {
5656
@Override public String toString() { return "ShouldNotMatch"; }
5757
}
5858

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public final class CombinableTest {
6060
assertMismatchDescription("was <6>", EITHER_3_OR_4, 6);
6161
}
6262

63+
@SuppressWarnings("UnusedAssignment")
6364
@Test public void
6465
picksUpTypeFromLeftHandSideOfExpression() {
6566
@SuppressWarnings("unused")

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ public final class IsInstanceOfTest {
5151
assertMatches(any(short.class), (short)1);
5252
}
5353

54+
@SuppressWarnings("UnusedAssignment")
5455
@Test public void
5556
instanceOfRequiresACastToReturnTheCorrectTypeForUseInJMock() {
5657
@SuppressWarnings("unused")
5758
Integer anInteger = (Integer)with(instanceOf(Integer.class));
5859
}
5960

61+
@SuppressWarnings("UnusedAssignment")
6062
@Test public void
6163
anyWillReturnTheCorrectTypeForUseInJMock() {
6264
@SuppressWarnings("unused")

hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static <E> Matcher<E[]> arrayContaining(E... items) {
6767
*/
6868
@SafeVarargs
6969
public static <E> Matcher<E[]> arrayContaining(Matcher<? super E>... itemMatchers) {
70-
return arrayContaining(Wrapping.<E>nullSafe(itemMatchers));
70+
return arrayContaining(Wrapping.nullSafe(itemMatchers));
7171
}
7272

7373
/**

hamcrest-library/src/main/java/org/hamcrest/collection/IsMapWithSize.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected Integer featureValueOf(Map<? extends K, ? extends V> actual) {
3030
* a matcher for the size of an examined {@link java.util.Map}
3131
*/
3232
public static <K, V> Matcher<Map<? extends K, ? extends V>> aMapWithSize(Matcher<? super Integer> sizeMatcher) {
33-
return new IsMapWithSize<K, V>(sizeMatcher);
33+
return new IsMapWithSize<>(sizeMatcher);
3434
}
3535

3636
/**

hamcrest-library/src/test/java/org/hamcrest/collection/HasSubsequenceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ public String toString() {
8181
}
8282
}
8383

84-
public static WithValue withValue(int value) {
84+
private static WithValue withValue(int value) {
8585
return new WithValue(value);
8686
}
8787

88-
public static Matcher<WithValue> value(int value) {
88+
private static Matcher<WithValue> value(int value) {
8989
return new FeatureMatcher<WithValue, Integer>(equalTo(value), "value with", "value") {
9090
@Override
9191
protected Integer featureValueOf(WithValue actual) {

hamcrest-library/src/test/java/org/hamcrest/comparator/ComparatorMatcherBuilderTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public CustomInt(int value) {
122122
this.value = value;
123123
}
124124

125+
@SuppressWarnings("NullableProblems")
125126
@Override
126127
public int compareTo(CustomInt other) {
127128
return value - other.value;

hamcrest-library/src/test/java/org/hamcrest/comparator/ComparatorMatcherTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public CustomInt(int value) {
8282
this.value = value;
8383
}
8484

85+
@SuppressWarnings("NullableProblems")
8586
@Override
8687
public int compareTo(CustomInt other) {
8788
return value - other.value;

hamcrest-library/src/test/java/org/hamcrest/number/OrderingComparisonTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public CustomInt(int value) {
7979
this.value = value;
8080
}
8181

82+
@SuppressWarnings("NullableProblems")
8283
public int compareTo(CustomInt other) {
8384
return value - other.value;
8485
}

0 commit comments

Comments
 (0)