Migrate from deprecated API

This commit is contained in:
Gary Gregory 2024-07-09 22:30:38 -04:00
parent 71a3d088c4
commit 14fa6cab97
7 changed files with 11 additions and 11 deletions

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
/**

View File

@ -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);
}
}