Migrate toward java.util.function

- Package-private changes only
- Maintains binary and source compatibility
This commit is contained in:
Gary Gregory 2024-07-11 11:18:12 -04:00
parent ed01dd2d0e
commit bc8ad80ec6
1 changed files with 3 additions and 3 deletions

View File

@ -127,14 +127,14 @@ final class FunctorUtils {
* @param predicates the predicates to validate
* @return predicate array
*/
static <T> Predicate<? super T>[] validate(final Collection<? extends Predicate<? super T>> predicates) {
static <T> Predicate<? super T>[] validate(final Collection<? extends java.util.function.Predicate<? super T>> predicates) {
Objects.requireNonNull(predicates, "predicates");
// convert to array like this to guarantee iterator() ordering
@SuppressWarnings("unchecked") // OK
final Predicate<? super T>[] preds = new Predicate[predicates.size()];
int i = 0;
for (final Predicate<? super T> predicate : predicates) {
preds[i] = predicate;
for (final java.util.function.Predicate<? super T> predicate : predicates) {
preds[i] = (Predicate<? super T>) predicate;
if (preds[i] == null) {
throw new NullPointerException("predicates[" + i + "]");
}