From a93a4e8715acfd5aaa6714214878855e2c61565f Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Tue, 12 Dec 2017 18:17:16 +0100 Subject: [PATCH] Use String.equalsIgnoreCase() where possible Closes gh-11330 --- .../web/reactive/error/AbstractErrorWebExceptionHandler.java | 2 +- .../web/servlet/error/AbstractErrorController.java | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java index e662a499fb..0044f6c309 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java @@ -130,7 +130,7 @@ public abstract class AbstractErrorWebExceptionHandler */ protected boolean isTraceEnabled(ServerRequest request) { String parameter = request.queryParam("trace").orElse("false"); - return !"false".equals(parameter.toLowerCase()); + return !"false".equalsIgnoreCase(parameter); } /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/AbstractErrorController.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/AbstractErrorController.java index 1a76f641ac..e0bbaf22a7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/AbstractErrorController.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/AbstractErrorController.java @@ -76,10 +76,7 @@ public abstract class AbstractErrorController implements ErrorController { protected boolean getTraceParameter(HttpServletRequest request) { String parameter = request.getParameter("trace"); - if (parameter == null) { - return false; - } - return !"false".equals(parameter.toLowerCase()); + return !"false".equalsIgnoreCase(parameter); } protected HttpStatus getStatus(HttpServletRequest request) {