diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java index 5918e8c7a..a4d9d8614 100644 --- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java +++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java @@ -716,7 +716,7 @@ public class IteratorUtils { if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); - closure.execute(element); + closure.accept(element); } } } @@ -742,7 +742,7 @@ public class IteratorUtils { if (!iterator.hasNext()) { return element; } - closure.execute(element); + closure.accept(element); } } return null; diff --git a/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java b/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java index de2902c6c..892ec0b26 100644 --- a/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java @@ -107,7 +107,7 @@ public class ChainedClosure implements Closure, Serializable { @Override public void execute(final E input) { for (final Closure iClosure : iClosures) { - iClosure.execute(input); + iClosure.accept(input); } } diff --git a/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java b/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java index 6bd24e8b8..f329e5e87 100644 --- a/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java @@ -76,7 +76,7 @@ public class ClosureTransformer implements Transformer, Serializable { */ @Override public T transform(final T input) { - iClosure.execute(input); + iClosure.accept(input); return input; } diff --git a/src/main/java/org/apache/commons/collections4/functors/ForClosure.java b/src/main/java/org/apache/commons/collections4/functors/ForClosure.java index 766b2d3e3..907d6e80a 100644 --- a/src/main/java/org/apache/commons/collections4/functors/ForClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/ForClosure.java @@ -78,7 +78,7 @@ public class ForClosure implements Closure { @Override public void execute(final E input) { for (int i = 0; i < iCount; i++) { - iClosure.execute(input); + iClosure.accept(input); } } diff --git a/src/main/java/org/apache/commons/collections4/functors/IfClosure.java b/src/main/java/org/apache/commons/collections4/functors/IfClosure.java index 17a1fd349..277981593 100644 --- a/src/main/java/org/apache/commons/collections4/functors/IfClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/IfClosure.java @@ -113,9 +113,9 @@ public class IfClosure implements Closure, Serializable { @Override public void execute(final E input) { if (iPredicate.evaluate(input)) { - iTrueClosure.execute(input); + iTrueClosure.accept(input); } else { - iFalseClosure.execute(input); + iFalseClosure.accept(input); } } 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 9a6b906e4..1b5013f6e 100644 --- a/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java @@ -143,11 +143,11 @@ public class SwitchClosure implements Closure, Serializable { public void execute(final E input) { for (int i = 0; i < iPredicates.length; i++) { if (iPredicates[i].evaluate(input)) { - iClosures[i].execute(input); + iClosures[i].accept(input); return; } } - iDefault.execute(input); + iDefault.accept(input); } /** diff --git a/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java b/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java index e4e69598e..5bded3e02 100644 --- a/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java @@ -80,10 +80,10 @@ public class WhileClosure implements Closure { @Override public void execute(final E input) { if (iDoLoop) { - iClosure.execute(input); + iClosure.accept(input); } while (iPredicate.evaluate(input)) { - iClosure.execute(input); + iClosure.accept(input); } }