Skip to content

Commit 2cccaf4

Browse files
committed
removed intermediate variable, force cast, remove warnings
1 parent 7de65a3 commit 2cccaf4

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎hamcrest-library/src/main/java/org/hamcrest/collection/IsEmptyCollection.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ public static <E> Matcher<Collection<? extends E>> empty() {
4747
* For example:
4848
* <pre>assertThat(new ArrayList&lt;String&gt;(), is(emptyCollectionOf(String.class)))</pre>
4949
*
50-
* @param type
50+
* @param unusedToForceReturnType
5151
* the type of the collection's content
5252
*/
53+
@SuppressWarnings({"unchecked", "UnusedParameters"})
5354
@Factory
54-
public static <E> Matcher<Collection<E>> emptyCollectionOf(Class<E> type) {
55+
public static <E> Matcher<Collection<E>> emptyCollectionOf(Class<E> unusedToForceReturnType) {
5556
return (Matcher)empty();
5657
}
5758
}

‎hamcrest-library/src/main/java/org/hamcrest/collection/IsEmptyIterable.java‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,12 @@ public static <E> Matcher<Iterable<? extends E>> emptyIterable() {
4242
* For example:
4343
* <pre>assertThat(new ArrayList&lt;String&gt;(), is(emptyIterableOf(String.class)))</pre>
4444
*
45-
* @param type
45+
* @param unusedToForceReturnType
4646
* the type of the iterable's content
4747
*/
48+
@SuppressWarnings({"unchecked", "UnusedParameters"})
4849
@Factory
49-
public static <E> Matcher<Iterable<E>> emptyIterableOf(Class<E> type) {
50-
@SuppressWarnings({ "rawtypes", "unchecked" })
51-
final Matcher<Iterable<E>> result = (Matcher)emptyIterable();
52-
return result;
50+
public static <E> Matcher<Iterable<E>> emptyIterableOf(Class<E> unusedToForceReturnType) {
51+
return (Matcher)emptyIterable();
5352
}
5453
}

0 commit comments

Comments
 (0)