|
|
0ffb3f |
From d33031924faa557bb43ba0471f74d942ddfeae50 Mon Sep 17 00:00:00 2001
|
|
|
0ffb3f |
From: Mikolaj Izdebski <mizdebsk@redhat.com>
|
|
|
0ffb3f |
Date: Tue, 5 Nov 2019 14:50:23 +0100
|
|
|
0ffb3f |
Subject: [PATCH] Fix build with OpenJDK 11
|
|
|
0ffb3f |
|
|
|
0ffb3f |
---
|
|
|
0ffb3f |
.../src/main/java/org/hamcrest/collection/ArrayMatching.java | 3 ++-
|
|
|
0ffb3f |
.../org/hamcrest/collection/IsArrayContainingInAnyOrder.java | 2 +-
|
|
|
0ffb3f |
.../org/hamcrest/collection/IsArrayContainingInOrder.java | 2 +-
|
|
|
0ffb3f |
.../hamcrest/collection/IsIterableContainingInAnyOrder.java | 2 +-
|
|
|
0ffb3f |
.../collection/IsIterableContainingInRelativeOrder.java | 2 +-
|
|
|
0ffb3f |
hamcrest/src/main/java/org/hamcrest/core/AllOf.java | 2 +-
|
|
|
0ffb3f |
hamcrest/src/main/java/org/hamcrest/core/AnyOf.java | 2 +-
|
|
|
0ffb3f |
.../src/main/java/org/hamcrest/core/CombinableMatcher.java | 4 ++--
|
|
|
0ffb3f |
8 files changed, 10 insertions(+), 9 deletions(-)
|
|
|
0ffb3f |
|
|
|
0ffb3f |
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java b/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java
|
|
|
0ffb3f |
index fc968e0..baab775 100644
|
|
|
0ffb3f |
--- a/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java
|
|
|
0ffb3f |
+++ b/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java
|
|
|
0ffb3f |
@@ -67,7 +67,8 @@ public class ArrayMatching {
|
|
|
0ffb3f |
*/
|
|
|
0ffb3f |
@SafeVarargs
|
|
|
0ffb3f |
public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher... itemMatchers) {
|
|
|
0ffb3f |
- return arrayContainingInAnyOrder(asList(itemMatchers));
|
|
|
0ffb3f |
+ Collection<Matcher<? super E>> itemMatchersList = asList(itemMatchers);
|
|
|
0ffb3f |
+ return new ArrayAsIterableMatcher<>(new IsIterableContainingInAnyOrder<>(itemMatchersList), itemMatchersList, "in any order");
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
|
|
|
0ffb3f |
/**
|
|
|
0ffb3f |
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java
|
|
|
0ffb3f |
index 7e72a62..c0c7efc 100644
|
|
|
0ffb3f |
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java
|
|
|
0ffb3f |
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java
|
|
|
0ffb3f |
@@ -59,7 +59,7 @@ public class IsArrayContainingInAnyOrder<E> extends TypeSafeMatcher<E[]> {
|
|
|
0ffb3f |
* a list of matchers, each of which must be satisfied by an entry in an examined array
|
|
|
0ffb3f |
*/
|
|
|
0ffb3f |
public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher... itemMatchers) {
|
|
|
0ffb3f |
- return arrayContainingInAnyOrder(Arrays.asList(itemMatchers));
|
|
|
0ffb3f |
+ return new IsArrayContainingInAnyOrder<E>(Arrays.asList(itemMatchers));
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
|
|
|
0ffb3f |
/**
|
|
|
0ffb3f |
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java
|
|
|
0ffb3f |
index c046914..2022f1a 100644
|
|
|
0ffb3f |
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java
|
|
|
0ffb3f |
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java
|
|
|
0ffb3f |
@@ -73,7 +73,7 @@ public class IsArrayContainingInOrder<E> extends TypeSafeMatcher<E[]> {
|
|
|
0ffb3f |
* the matchers that must be satisfied by the items in the examined array
|
|
|
0ffb3f |
*/
|
|
|
0ffb3f |
public static <E> Matcher<E[]> arrayContaining(Matcher... itemMatchers) {
|
|
|
0ffb3f |
- return arrayContaining(asList(itemMatchers));
|
|
|
0ffb3f |
+ return new IsArrayContainingInOrder<E>(asList(itemMatchers));
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
|
|
|
0ffb3f |
/**
|
|
|
0ffb3f |
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java
|
|
|
0ffb3f |
index d6a9a33..9a7e6c0 100644
|
|
|
0ffb3f |
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java
|
|
|
0ffb3f |
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java
|
|
|
0ffb3f |
@@ -98,7 +98,7 @@ public class IsIterableContainingInAnyOrder<T> extends TypeSafeDiagnosingMatcher
|
|
|
0ffb3f |
*/
|
|
|
0ffb3f |
@SafeVarargs
|
|
|
0ffb3f |
public static <T> Matcher<Iterable<? extends T>> containsInAnyOrder(Matcher... itemMatchers) {
|
|
|
0ffb3f |
- return containsInAnyOrder(Arrays.asList(itemMatchers));
|
|
|
0ffb3f |
+ return new IsIterableContainingInAnyOrder<T>(Arrays.asList(itemMatchers));
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
|
|
|
0ffb3f |
/**
|
|
|
0ffb3f |
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java
|
|
|
0ffb3f |
index 0657768..06d6a57 100644
|
|
|
0ffb3f |
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java
|
|
|
0ffb3f |
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java
|
|
|
0ffb3f |
@@ -99,7 +99,7 @@ public class IsIterableContainingInRelativeOrder<E> extends TypeSafeDiagnosingMa
|
|
|
0ffb3f |
*/
|
|
|
0ffb3f |
@SafeVarargs
|
|
|
0ffb3f |
public static <E> Matcher<Iterable<? extends E>> containsInRelativeOrder(Matcher... itemMatchers) {
|
|
|
0ffb3f |
- return containsInRelativeOrder(asList(itemMatchers));
|
|
|
0ffb3f |
+ return new IsIterableContainingInRelativeOrder<E>(asList(itemMatchers));
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
|
|
|
0ffb3f |
/**
|
|
|
0ffb3f |
diff --git a/hamcrest/src/main/java/org/hamcrest/core/AllOf.java b/hamcrest/src/main/java/org/hamcrest/core/AllOf.java
|
|
|
0ffb3f |
index b8c3faa..f8951bd 100644
|
|
|
0ffb3f |
--- a/hamcrest/src/main/java/org/hamcrest/core/AllOf.java
|
|
|
0ffb3f |
+++ b/hamcrest/src/main/java/org/hamcrest/core/AllOf.java
|
|
|
0ffb3f |
@@ -56,6 +56,6 @@ public class AllOf<T> extends DiagnosingMatcher<T> {
|
|
|
0ffb3f |
*/
|
|
|
0ffb3f |
@SafeVarargs
|
|
|
0ffb3f |
public static <T> Matcher<T> allOf(Matcher... matchers) {
|
|
|
0ffb3f |
- return allOf(Arrays.asList(matchers));
|
|
|
0ffb3f |
+ return new AllOf<T>(Arrays.asList(matchers));
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
diff --git a/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java b/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java
|
|
|
0ffb3f |
index 7a22c22..5a63574 100644
|
|
|
0ffb3f |
--- a/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java
|
|
|
0ffb3f |
+++ b/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java
|
|
|
0ffb3f |
@@ -46,6 +46,6 @@ public class AnyOf<T> extends ShortcutCombination<T> {
|
|
|
0ffb3f |
*/
|
|
|
0ffb3f |
@SafeVarargs
|
|
|
0ffb3f |
public static <T> AnyOf<T> anyOf(Matcher... matchers) {
|
|
|
0ffb3f |
- return anyOf(Arrays.asList(matchers));
|
|
|
0ffb3f |
+ return new AnyOf<T>(Arrays.asList(matchers));
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
diff --git a/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java b/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java
|
|
|
0ffb3f |
index e37efce..6b44884 100644
|
|
|
0ffb3f |
--- a/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java
|
|
|
0ffb3f |
+++ b/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java
|
|
|
0ffb3f |
@@ -57,7 +57,7 @@ public class CombinableMatcher<T> extends TypeSafeDiagnosingMatcher<T> {
|
|
|
0ffb3f |
this.first = matcher;
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
public CombinableMatcher<X> and(Matcher other) {
|
|
|
0ffb3f |
- return new CombinableMatcher<>(first).and(other);
|
|
|
0ffb3f |
+ return new CombinableMatcher<>(first).and((Matcher)other);
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
|
|
|
0ffb3f |
@@ -76,7 +76,7 @@ public class CombinableMatcher<T> extends TypeSafeDiagnosingMatcher<T> {
|
|
|
0ffb3f |
this.first = matcher;
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
public CombinableMatcher<X> or(Matcher other) {
|
|
|
0ffb3f |
- return new CombinableMatcher<>(first).or(other);
|
|
|
0ffb3f |
+ return new CombinableMatcher<>(first).or((Matcher)other);
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
}
|
|
|
0ffb3f |
--
|
|
|
0ffb3f |
2.21.0
|
|
|
0ffb3f |
|