From d1ccef62b5674d2f6ede7331d0451e82e5651b43 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Wed, 28 Jun 2017 15:07:07 +0100 Subject: [PATCH] FunctionHandlerMapping needs to be defensive with debug flag Spring Boot apps often run with --debug (no boolean value), so we need to be defensive and not barf if it's empty (and therefore not convertible to a boolean) --- .../cloud/function/web/flux/FunctionHandlerMapping.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/flux/FunctionHandlerMapping.java b/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/flux/FunctionHandlerMapping.java index 1db849443..1b0d75b2d 100644 --- a/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/flux/FunctionHandlerMapping.java +++ b/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/flux/FunctionHandlerMapping.java @@ -52,7 +52,7 @@ public class FunctionHandlerMapping extends RequestMappingHandlerMapping private String prefix = ""; @Value("${debug:${DEBUG:false}}") - private boolean debug = false; + private String debug = "false"; @Autowired public FunctionHandlerMapping(FunctionCatalog catalog, FunctionInspector inspector) { @@ -65,7 +65,7 @@ public class FunctionHandlerMapping extends RequestMappingHandlerMapping @Override public void afterPropertiesSet() { super.afterPropertiesSet(); - this.controller.setDebug(debug); + this.controller.setDebug(!"false".equals(debug)); detectHandlerMethods(controller); while (prefix.endsWith("/")) { prefix = prefix.substring(0, prefix.length() - 1);