From d52bf83ab268863cd238d8a14026d37967e2d7ac Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 30 Apr 2020 16:15:57 -0700 Subject: [PATCH] Polish --- .../boot/build/JavaConventions.java | 1 + .../web/servlet/ManagementErrorEndpoint.java | 1 + .../autoconfigure/web/ErrorProperties.java | 27 ++++++------------- .../convert/ConversionServiceArguments.java | 1 - 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java index 6402eafe3fb..201ed3ec411 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java @@ -76,6 +76,7 @@ import org.springframework.util.FileCopyUtils; * @author Andy Wilkinson * @author Christoph Dreis * @author Mike Smithson + * @author Scott Frederick */ class JavaConventions { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpoint.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpoint.java index be9909a0506..81f3e9099f2 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpoint.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpoint.java @@ -62,6 +62,7 @@ public class ManagementErrorEndpoint { case ALWAYS: return true; case ON_PARAM: + case ON_TRACE_PARAM: return getBooleanParameter(request, "trace"); default: return false; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ErrorProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ErrorProperties.java index 0d7e7a40265..a2a7b083445 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ErrorProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ErrorProperties.java @@ -90,11 +90,11 @@ public class ErrorProperties { } public IncludeAttribute getIncludeBindingErrors() { - return this.includeMessage; + return this.includeBindingErrors; } - public void setIncludeBindingErrors(IncludeAttribute includeMessage) { - this.includeMessage = includeMessage; + public void setIncludeBindingErrors(IncludeAttribute includeBindingErrors) { + this.includeBindingErrors = includeBindingErrors; } public Whitelabel getWhitelabel() { @@ -109,34 +109,23 @@ public class ErrorProperties { /** * Never add stacktrace information. */ - NEVER(IncludeAttribute.NEVER), + NEVER, /** * Always add stacktrace information. */ - ALWAYS(IncludeAttribute.ALWAYS), + ALWAYS, /** * Add error attribute when the appropriate request parameter is "true". */ - ON_PARAM(IncludeAttribute.ON_PARAM), + ON_PARAM, /** * Add stacktrace information when the "trace" request parameter is "true". - * @deprecated since 2.3.0 in favor of {@link #ON_PARAM} */ - @Deprecated - ON_TRACE_PARAM(IncludeAttribute.ON_PARAM); - - private final IncludeAttribute include; - - IncludeStacktrace(IncludeAttribute include) { - this.include = include; - } - - public IncludeAttribute getInclude() { - return this.include; - } + @Deprecated // since 2.3.0 in favor of {@link #ON_PARAM} + ON_TRACE_PARAM; } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/ConversionServiceArguments.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/ConversionServiceArguments.java index f9a53036e95..a77dc5e4be0 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/ConversionServiceArguments.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/ConversionServiceArguments.java @@ -38,7 +38,6 @@ import org.springframework.format.support.FormattingConversionService; final class ConversionServiceArguments { private ConversionServiceArguments() { - } static Stream with(Formatter formatter) {