From 5f3f1a1f1124c8a1dce629662d93df4ac3dd9688 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Wed, 15 Aug 2018 10:43:12 +0900 Subject: [PATCH] Polish Closes gh-14067 --- ...figurationPropertiesReportEndpointTests.java | 8 ++++---- .../condition/OnWebApplicationCondition.java | 17 +++++++---------- .../asciidoc/production-ready-features.adoc | 4 ++-- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java index cfc56337c5..87c090ebd3 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java @@ -315,14 +315,14 @@ public class ConfigurationPropertiesReportEndpointTests { this.simpleBoolean = simpleBoolean; } - public void setMixedBoolean(Boolean mixedBoolean) { - this.mixedBoolean = mixedBoolean; - } - public boolean isMixedBoolean() { return (this.mixedBoolean != null) ? this.mixedBoolean : false; } + public void setMixedBoolean(Boolean mixedBoolean) { + this.mixedBoolean = mixedBoolean; + } + public String getmIxedCase() { return this.mIxedCase; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java index d6143221c9..cf4d9610a8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java @@ -62,14 +62,14 @@ class OnWebApplicationCondition extends SpringBootCondition { private ConditionOutcome isWebApplication(ConditionContext context, AnnotatedTypeMetadata metadata, boolean required) { - Type type = deduceType(metadata); - if (Type.SERVLET == type) { + switch (deduceType(metadata)) { + case SERVLET: return isServletWebApplication(context); - } - else if (Type.REACTIVE == type) { + + case REACTIVE: return isReactiveWebApplication(context); - } - else { + + default: return isAnyWebApplication(context, required); } } @@ -88,10 +88,7 @@ class OnWebApplicationCondition extends SpringBootCondition { return new ConditionOutcome(reactiveOutcome.isMatch(), message.because(reactiveOutcome.getMessage())); } - boolean finalOutcome = (required - ? servletOutcome.isMatch() && reactiveOutcome.isMatch() - : servletOutcome.isMatch() || reactiveOutcome.isMatch()); - return new ConditionOutcome(finalOutcome, + return new ConditionOutcome(servletOutcome.isMatch() || reactiveOutcome.isMatch(), message.because(servletOutcome.getMessage()).append("and") .append(reactiveOutcome.getMessage())); } diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index 5337dcc579..560fac6f16 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -1470,8 +1470,8 @@ server] to use can be provided using: ==== JMX Micrometer provides a hierarchical mapping to {micrometer-registry-documentation}/jmx[JMX], primarily as a cheap and portable way to -view metrics locally.By default, metrics are exported to the `metrics` JMX domain. The -domain to use can be provided provided using: +view metrics locally. By default, metrics are exported to the `metrics` JMX domain. The +domain to use can be provided using: [source,properties,indent=0] ----