mirror of
https://github.com/apache/commons-collections.git
synced 2025-02-10 03:56:11 +00:00
Migrate toward java.util.function.Predicate
- Package-private changes only - Maintains binary and source compatibility
This commit is contained in:
parent
3618193221
commit
68c0814f23
@ -118,7 +118,7 @@ public class ChainedClosure<E> implements Closure<E>, Serializable {
|
||||
* @since 3.1
|
||||
*/
|
||||
public Closure<? super E>[] getClosures() {
|
||||
return FunctorUtils.<E>copy(iClosures);
|
||||
return FunctorUtils.copy(iClosures);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -81,17 +81,17 @@ final class FunctorUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone the closures to ensure that the internal reference can't be messed with.
|
||||
* Clones the consumers to ensure that the internal references can't be updated.
|
||||
*
|
||||
* @param closures the closures to copy
|
||||
* @return the cloned closures
|
||||
* @param consumers the consumers to copy.
|
||||
* @return the cloned consumers.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
static <E> Closure<E>[] copy(final Closure<? super E>... closures) {
|
||||
if (closures == null) {
|
||||
static <C extends Consumer<?>> C[] copy(final C... consumers) {
|
||||
if (consumers == null) {
|
||||
return null;
|
||||
}
|
||||
return (Closure<E>[]) closures.clone();
|
||||
return consumers.clone();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -157,7 +157,7 @@ public class SwitchClosure<E> implements Closure<E>, Serializable {
|
||||
* @since 3.1
|
||||
*/
|
||||
public Closure<? super E>[] getClosures() {
|
||||
return FunctorUtils.<E>copy(iClosures);
|
||||
return FunctorUtils.copy(iClosures);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user