diff --git a/core/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java b/core/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java index dd92b9b7df3..5e6da552e8e 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java @@ -349,11 +349,8 @@ public final class LambdaSafe { @Override public boolean match(Class callbackType, C callbackInstance, A argument, Object[] additionalArguments) { ResolvableType type = ResolvableType.forClass(callbackType, callbackInstance.getClass()); - if (type.getGenerics().length == 1 && type.resolveGeneric() != null) { - return type.resolveGeneric().isInstance(argument); - } - - return true; + return type.getGenerics().length == 1 && type.resolveGeneric() != null + && type.resolveGeneric().isInstance(argument); } }