Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/hamcrest#331' into java-1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
tumbarumba committed Jun 30, 2024
2 parents 25bed14 + 484838e commit cd14eae
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 16 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ os: linux
dist: trusty

jdk:
- openjdk7
- oraclejdk8
- openjdk8
- openjdk11
Expand Down
2 changes: 1 addition & 1 deletion BUILDING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

--[ Build requirements ]-------------------------------------

* JDK 1.7
* JDK 1.8

--[ Building from the command line ]-------------------------

Expand Down
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Hamcrest Changes

## Version 3.0 (Unreleased)

### Improvements

* Java 1.8 or newer ([Issue #331](https://github.com/hamcrest/JavaHamcrest/issues/331)).

TBD

### Bugfixes

TBD

## Version 2.3 (Unreleased)

### Improvements
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ apply plugin: 'osgi'
apply plugin: 'maven-publish'

group = "org.hamcrest"
version = "2.3-SNAPSHOT"
version = "3.0-SNAPSHOT"

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
8 changes: 6 additions & 2 deletions hamcrest/hamcrest.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ apply plugin: 'osgi'
version = rootProject.version

dependencies {
testImplementation(group: 'junit', name: 'junit', version: '4.13.2') {
transitive = false
testImplementation(group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.2') {
transitive = true
}
testImplementation(group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.8.2') {
transitive = true
exclude(module: 'hamcrest-core')
}
}

Expand Down
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 cd14eae

Please sign in to comment.