Skip to content

Commit

Permalink
hamcrest#331 Bumped source and target compatibility to Java 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdemaeyer authored and nhojpatrick committed Feb 13, 2022
1 parent 044c832 commit a42245d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static <T> Matcher<T[]> hasItemInArray(T element) {
*/
@SafeVarargs
public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers) {
return arrayContainingInAnyOrder(asList(itemMatchers));
return arrayContainingInAnyOrder((Collection) asList(itemMatchers));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void describeTo(Description description) {
* @return The matcher.
*/
public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers) {
return arrayContainingInAnyOrder(Arrays.asList(itemMatchers));
return arrayContainingInAnyOrder((Collection) Arrays.asList(itemMatchers));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static <E> Matcher<E[]> arrayContaining(E... items) {
* @return The matcher.
*/
public static <E> Matcher<E[]> arrayContaining(Matcher<? super E>... itemMatchers) {
return arrayContaining(asList(itemMatchers));
return arrayContaining((List) asList(itemMatchers));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private boolean isMatched(S item) {
*/
@SafeVarargs
public static <T> Matcher<Iterable<? extends T>> containsInAnyOrder(Matcher<? super T>... itemMatchers) {
return containsInAnyOrder(Arrays.asList(itemMatchers));
return containsInAnyOrder((Collection) Arrays.asList(itemMatchers));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static <E> Matcher<Iterable<? extends E>> containsInRelativeOrder(E... it
*/
@SafeVarargs
public static <E> Matcher<Iterable<? extends E>> containsInRelativeOrder(Matcher<? super E>... itemMatchers) {
return containsInRelativeOrder(asList(itemMatchers));
return containsInRelativeOrder((List) asList(itemMatchers));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion hamcrest/src/main/java/org/hamcrest/core/AllOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) {
*/
@SafeVarargs
public static <T> Matcher<T> allOf(Matcher<? super T>... matchers) {
return allOf(Arrays.asList(matchers));
return allOf((Iterable) Arrays.asList(matchers));
}

}
2 changes: 1 addition & 1 deletion hamcrest/src/main/java/org/hamcrest/core/AnyOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static <T> AnyOf<T> anyOf(Iterable<Matcher<? super T>> matchers) {
*/
@SafeVarargs
public static <T> AnyOf<T> anyOf(Matcher<? super T>... matchers) {
return anyOf(Arrays.asList(matchers));
return anyOf((Iterable) Arrays.asList(matchers));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public CombinableBothMatcher(Matcher<? super X> matcher) {
this.first = matcher;
}
public CombinableMatcher<X> and(Matcher<? super X> other) {
return new CombinableMatcher<>(first).and(other);
return new CombinableMatcher(first).and(other);
}
}

Expand All @@ -94,7 +94,7 @@ public CombinableEitherMatcher(Matcher<? super X> matcher) {
this.first = matcher;
}
public CombinableMatcher<X> or(Matcher<? super X> other) {
return new CombinableMatcher<>(first).or(other);
return new CombinableMatcher(first).or(other);
}
}

Expand Down

0 comments on commit a42245d

Please sign in to comment.