From 817a8a830278715a93f8f2455bf0efc64342eb41 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 10 Aug 2018 09:48:57 +0200 Subject: [PATCH] Polish --- .../main/java/org/springframework/boot/util/LambdaSafe.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java index 78267f8552..018153a77d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java @@ -187,7 +187,7 @@ public final class LambdaSafe { if (argument == null) { return false; } - Class argumentType = argument.getClass(); + Class argumentType = argument.getClass(); // On Java 8, the message starts with the class name: "java.lang.String cannot // be cast..." if (message.startsWith(argumentType.getName())) { @@ -208,9 +208,7 @@ public final class LambdaSafe { Object module = ReflectionUtils.invokeMethod(CLASS_GET_MODULE, argumentType); Object moduleName = ReflectionUtils.invokeMethod(MODULE_GET_NAME, module); - if (message.startsWith(moduleName + "/" + argumentType.getName())) { - return true; - } + return message.startsWith(moduleName + "/" + argumentType.getName()); } return false; }