Polish "Replace relevant code with lambda"
Closes gh-1454
This commit is contained in:
@@ -47,12 +47,6 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
public abstract class ReflectionUtils {
|
||||
|
||||
/**
|
||||
* Pre-built FieldFilter that matches all non-static, non-final fields.
|
||||
*/
|
||||
public static final FieldFilter COPYABLE_FIELDS =
|
||||
field -> !(Modifier.isStatic(field.getModifiers()) || Modifier.isFinal(field.getModifiers()));
|
||||
|
||||
/**
|
||||
* Naming prefix for CGLIB-renamed methods.
|
||||
* @see #isCglibRenamedMethod
|
||||
@@ -851,6 +845,13 @@ public abstract class ReflectionUtils {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pre-built FieldFilter that matches all non-static, non-final fields.
|
||||
*/
|
||||
public static final FieldFilter COPYABLE_FIELDS =
|
||||
field -> !(Modifier.isStatic(field.getModifiers()) || Modifier.isFinal(field.getModifiers()));
|
||||
|
||||
|
||||
/**
|
||||
* Pre-built MethodFilter that matches all non-bridge methods.
|
||||
*/
|
||||
|
||||
@@ -21,9 +21,6 @@ import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Adapts a {@link CompletableFuture} or {@link CompletionStage} into a
|
||||
@@ -53,9 +50,9 @@ public class CompletableToListenableFutureAdapter<T> implements ListenableFuture
|
||||
*/
|
||||
public CompletableToListenableFutureAdapter(CompletableFuture<T> completableFuture) {
|
||||
this.completableFuture = completableFuture;
|
||||
this.completableFuture.handle((result, exception) -> {
|
||||
if (exception != null) {
|
||||
callbacks.failure(exception);
|
||||
this.completableFuture.handle((result, ex) -> {
|
||||
if (ex != null) {
|
||||
callbacks.failure(ex);
|
||||
}
|
||||
else {
|
||||
callbacks.success(result);
|
||||
|
||||
Reference in New Issue
Block a user