diff --git a/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java index fe0ad219d..7e326dc64 100644 --- a/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java @@ -51,7 +51,7 @@ public abstract class AbstractQuantifierPredicate extends AbstractPredicate[] getPredicates() { - return FunctorUtils.copy(iPredicates); + return FunctorUtils.copy(iPredicates); } } diff --git a/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java index ddaa26c0c..a76cb2157 100644 --- a/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java @@ -84,8 +84,8 @@ public final class AllPredicate extends AbstractQuantifierPredicate { if (predicates.length == 1) { return coerce(predicates[0]); } - - return new AllPredicate<>(FunctorUtils.copy(predicates)); + // not needed in Eclipse but needed by the command line compiler + return new AllPredicate(FunctorUtils.copy(predicates)); } /** diff --git a/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java index 2dd278d4d..fbfb264d8 100644 --- a/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java @@ -82,7 +82,7 @@ public final class AnyPredicate extends AbstractQuantifierPredicate { if (predicates.length == 1) { return (Predicate) predicates[0]; } - return new AnyPredicate<>(FunctorUtils.copy(predicates)); + return new AnyPredicate(FunctorUtils.copy(predicates)); } /** diff --git a/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java b/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java index 36687265c..465051dbd 100644 --- a/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java +++ b/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java @@ -87,7 +87,7 @@ final class FunctorUtils { * @return the cloned consumers. */ @SuppressWarnings("unchecked") - static > C[] copy(final C... consumers) { + static > T[] copy(final T... consumers) { if (consumers == null) { return null; } @@ -103,11 +103,11 @@ final class FunctorUtils { * @return the cloned predicates */ @SuppressWarnings("unchecked") - static Predicate[] copy(final Predicate... predicates) { + static > T[] copy(final T... predicates) { if (predicates == null) { return null; } - return (Predicate[]) predicates.clone(); + return predicates.clone(); } /** diff --git a/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java b/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java index 1aa5b8b49..64f4de8d4 100644 --- a/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java @@ -72,7 +72,8 @@ public final class NonePredicate extends AbstractQuantifierPredicate { if (predicates.length == 0) { return TruePredicate.truePredicate(); } - return new NonePredicate<>(FunctorUtils.copy(predicates)); + // not needed in Eclipse but needed by the command line compiler + return new NonePredicate(FunctorUtils.copy(predicates)); } /** diff --git a/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java b/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java index a8b74935e..2c5853fdf 100644 --- a/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java @@ -72,7 +72,8 @@ public final class OnePredicate extends AbstractQuantifierPredicate { if (predicates.length == 1) { return (Predicate) predicates[0]; } - return new OnePredicate<>(FunctorUtils.copy(predicates)); + // not needed in Eclipse but needed by the command line compiler + return new OnePredicate(FunctorUtils.copy(predicates)); } /** diff --git a/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java b/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java index eda6c36f4..32775d0df 100644 --- a/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java @@ -177,7 +177,7 @@ public class SwitchClosure implements Closure, Serializable { * @since 3.1 */ public Predicate[] getPredicates() { - return FunctorUtils.copy(iPredicates); + return FunctorUtils.copy(iPredicates); } } diff --git a/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java b/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java index d113d816b..995d99a9e 100644 --- a/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java @@ -164,7 +164,7 @@ public class SwitchTransformer implements Transformer, Serializable * @since 3.1 */ public Predicate[] getPredicates() { - return FunctorUtils.copy(iPredicates); + return FunctorUtils.copy(iPredicates); } /**