Migrate from deprecated API
This commit is contained in:
parent
71a3d088c4
commit
14fa6cab97
|
@ -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;
|
||||
|
|
|
@ -107,7 +107,7 @@ public class ChainedClosure<E> implements Closure<E>, Serializable {
|
|||
@Override
|
||||
public void execute(final E input) {
|
||||
for (final Closure<? super E> iClosure : iClosures) {
|
||||
iClosure.execute(input);
|
||||
iClosure.accept(input);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ public class ClosureTransformer<T> implements Transformer<T, T>, Serializable {
|
|||
*/
|
||||
@Override
|
||||
public T transform(final T input) {
|
||||
iClosure.execute(input);
|
||||
iClosure.accept(input);
|
||||
return input;
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ public class ForClosure<E> implements Closure<E> {
|
|||
@Override
|
||||
public void execute(final E input) {
|
||||
for (int i = 0; i < iCount; i++) {
|
||||
iClosure.execute(input);
|
||||
iClosure.accept(input);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -113,9 +113,9 @@ public class IfClosure<E> implements Closure<E>, 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -143,11 +143,11 @@ public class SwitchClosure<E> implements Closure<E>, 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -80,10 +80,10 @@ public class WhileClosure<E> implements Closure<E> {
|
|||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue