Skip to content

Commit

Permalink
Merge branch 'hamcrest#331'
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdemaeyer committed Oct 3, 2021
2 parents 99f49e3 + ee3d147 commit bddc4c8
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 22 deletions.
12 changes: 1 addition & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,15 @@ language: java

os: linux

# Need to select an older Ubuntu distribution that supports JDK7
# Workaround for Oracle JDK
dist: trusty

jdk:
- openjdk7
- oraclejdk8
- openjdk8
- oraclejdk9
- openjdk11
- openjdk14

# Workaround to using openjdk7 with Gradle due to security issue:
# https://github.com/gradle/gradle/issues/2421
before_install:
- BCPROV_FILENAME=bcprov-ext-jdk15on-158.jar
- wget "https://bouncycastle.org/download/${BCPROV_FILENAME}"
- sudo mv $BCPROV_FILENAME /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext
- sudo perl -pi.bak -e 's/^(security\.provider\.)([0-9]+)/$1.($2+1)/ge' /etc/java-7-openjdk/security/java.security
- echo "security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider" | sudo tee -a /etc/java-7-openjdk/security/java.security

script:
- ./gradlew clean build javadoc
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ subprojects {
apply plugin: 'checkstyle'
apply plugin: 'java-library'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

group = rootProject.group
version = rootProject.version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,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 @@ -59,7 +59,7 @@ public void describeTo(Description description) {
* a list of matchers, each of which must be satisfied by an entry in an examined array
*/
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 @@ -73,7 +73,7 @@ public static <E> Matcher<E[]> arrayContaining(E... items) {
* the matchers that must be satisfied by the items in the examined array
*/
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 @@ -98,7 +98,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 @@ -99,7 +99,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 @@ -56,6 +56,6 @@ 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 @@ -46,6 +46,6 @@ 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 @@ -57,7 +57,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 @@ -76,7 +76,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);
}
}
}

0 comments on commit bddc4c8

Please sign in to comment.