From 45d85778b8c02820c5ec496525d539147afdc9aa Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Fri, 1 Nov 2019 14:04:43 +0900 Subject: [PATCH] Polish See gh-18838 --- .../web/embedded/JettyWebServerFactoryCustomizer.java | 8 ++++---- .../configurationdocs/SingleConfigurationTableEntry.java | 2 +- .../PropertyDescriptorResolver.java | 1 - .../immutable/DeducedImmutableClassProperties.java | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java index 0fc4a6ca7a..e004735280 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java @@ -124,19 +124,19 @@ public class JettyWebServerFactoryCustomizer @Override public void customize(Server server) { - setHandlerMaxHttpFormPostSize(maxHttpFormPostSize, server.getHandlers()); + setHandlerMaxHttpFormPostSize(server.getHandlers()); } - private void setHandlerMaxHttpFormPostSize(int maxHttpPostSize, Handler... handlers) { + private void setHandlerMaxHttpFormPostSize(Handler... handlers) { for (Handler handler : handlers) { if (handler instanceof ContextHandler) { ((ContextHandler) handler).setMaxFormContentSize(maxHttpFormPostSize); } else if (handler instanceof HandlerWrapper) { - setHandlerMaxHttpFormPostSize(maxHttpFormPostSize, ((HandlerWrapper) handler).getHandler()); + setHandlerMaxHttpFormPostSize(((HandlerWrapper) handler).getHandler()); } else if (handler instanceof HandlerCollection) { - setHandlerMaxHttpFormPostSize(maxHttpFormPostSize, ((HandlerCollection) handler).getHandlers()); + setHandlerMaxHttpFormPostSize(((HandlerCollection) handler).getHandlers()); } } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java index 0ce1e7fbf7..17ac8bc32a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java @@ -62,11 +62,11 @@ class SingleConfigurationTableEntry extends ConfigurationTableEntry { private void writeDefaultValue(AsciidocBuilder builder) { String defaultValue = (this.defaultValue != null) ? this.defaultValue : ""; - defaultValue = defaultValue.replace("\\", "\\\\").replace("|", "\\|"); if (defaultValue.isEmpty()) { builder.appendln("|"); } else { + defaultValue = defaultValue.replace("\\", "\\\\").replace("|", "\\|"); builder.appendln("|`+", defaultValue, "+`"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptorResolver.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptorResolver.java index 0f35c203f2..fc8572d131 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptorResolver.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptorResolver.java @@ -185,7 +185,6 @@ class PropertyDescriptorResolver { return isConstructorBoundType((TypeElement) type.getEnclosingElement(), env); } return false; - } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/DeducedImmutableClassProperties.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/DeducedImmutableClassProperties.java index e5c6de698f..5a5d799cd7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/DeducedImmutableClassProperties.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/DeducedImmutableClassProperties.java @@ -40,7 +40,7 @@ public class DeducedImmutableClassProperties { public static class Nested { - private String name; + private final String name; public Nested(String name) { this.name = name;