From 37c8c3669b34a8b9e0cf0e80355d2a04e292f449 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Wed, 17 Aug 2016 11:17:11 +0900 Subject: [PATCH] Polish Closes gh-6671 --- .../boot/autoconfigure/amqp/RabbitAutoConfiguration.java | 1 - .../boot/autoconfigure/amqp/RabbitProperties.java | 4 ++-- .../boot/autoconfigure/amqp/RabbitPropertiesTests.java | 4 ++-- .../JerseyAutoConfigurationObjectMapperProviderTests.java | 3 +-- spring-boot-docs/src/main/asciidoc/howto.adoc | 2 +- spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc | 2 +- spring-boot-parent/src/checkstyle/checkstyle.xml | 2 +- .../java/org/springframework/boot/system/package-info.java | 2 +- .../boot/bind/PropertySourcesPropertyValuesTests.java | 1 - 9 files changed, 9 insertions(+), 12 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java index 3959eb33b8c..39005cd230a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java @@ -94,7 +94,6 @@ public class RabbitAutoConfiguration { factory.setHost(config.determineHost()); } factory.setPort(config.determinePort()); - factory.setHost(config.determineHost()); if (config.determineUsername() != null) { factory.setUsername(config.determineUsername()); } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java index 850f6656d07..44750b1c443 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java @@ -243,7 +243,7 @@ public class RabbitProperties { /** * If addresses have been set and the first address has a virtual host it is returned. * Otherwise returns the result of calling {@code getVirtualHost()}. - * @return the password or {@code null} + * @return the virtual host or {@code null} * @see #setAddresses(String) * @see #getVirtualHost() */ @@ -755,7 +755,7 @@ public class RabbitProperties { private String parseVirtualHost(String input) { int hostIndex = input.indexOf("/"); - if (hostIndex >= 0 && hostIndex < input.length()) { + if (hostIndex >= 0) { this.virtualHost = input.substring(hostIndex + 1); if (this.virtualHost.length() == 0) { this.virtualHost = "/"; diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java index 946adee3bf3..c23cfc766a6 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java @@ -122,7 +122,7 @@ public class RabbitPropertiesTests { } @Test - public void determinedVirtualHostIsSlashWhenAddressHasTrailingSlash() { + public void determineVirtualHostIsSlashWhenAddressHasTrailingSlash() { this.properties.setAddresses("amqp://root:password@otherhost:1111/"); assertThat(this.properties.determineVirtualHost()).isEqualTo("/"); } @@ -199,7 +199,7 @@ public class RabbitPropertiesTests { @Test public void addressesDefaultsToNull() { - assertThat(this.properties.getAddresses()).isEqualTo(null); + assertThat(this.properties.getAddresses()).isNull(); } @Test diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfigurationObjectMapperProviderTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfigurationObjectMapperProviderTests.java index 2fa84566201..d782b2b3023 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfigurationObjectMapperProviderTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfigurationObjectMapperProviderTests.java @@ -68,8 +68,7 @@ public class JerseyAutoConfigurationObjectMapperProviderTests { ResponseEntity response = this.restTemplate.getForEntity("/rest/message", String.class); assertThat(HttpStatus.OK).isEqualTo(response.getStatusCode()); - assertThat(response.getBody()) - .isEqualTo(String.format("{\"subject\":\"Jersey\"}")); + assertThat(response.getBody()).isEqualTo("{\"subject\":\"Jersey\"}"); } @MinimalWebConfiguration diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index cea65a1e057..08003bd8959 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -1415,7 +1415,7 @@ for example: ---- To avoid a warning message about the HTML 5 template mode being deprecated and the HTML -template mode being used instead, you may also want to explicity configure +template mode being used instead, you may also want to explicitly configure `spring.thymeleaf.mode` to be `HTML`, for example: [source,properties,indent=0,subs="verbatim,quotes,attributes"] diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index c909397bf54..bcc5c8ca90d 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -4059,7 +4059,7 @@ resolved against their provided names. Apache Artemis was formed in 2015 when HornetQ was donated to the Apache Foundation. Make sure to use that rather than the deprecated HornetQ support. -NOTE: You should not try and use Artemis and HornetQ and the same time. +NOTE: You should not try and use Artemis and HornetQ at the same time. Spring Boot can auto-configure a `ConnectionFactory` when it detects that Artemis is available on the classpath. If the broker is present, an embedded broker is started and diff --git a/spring-boot-parent/src/checkstyle/checkstyle.xml b/spring-boot-parent/src/checkstyle/checkstyle.xml index afb93a3e7cc..855d278b495 100644 --- a/spring-boot-parent/src/checkstyle/checkstyle.xml +++ b/spring-boot-parent/src/checkstyle/checkstyle.xml @@ -133,7 +133,7 @@ + value="Please use BDDMockito imports." /> diff --git a/spring-boot/src/main/java/org/springframework/boot/system/package-info.java b/spring-boot/src/main/java/org/springframework/boot/system/package-info.java index 738b496a6c2..58970522ead 100644 --- a/spring-boot/src/main/java/org/springframework/boot/system/package-info.java +++ b/spring-boot/src/main/java/org/springframework/boot/system/package-info.java @@ -15,6 +15,6 @@ */ /** - * General actuator system support classes. + * General system support classes. */ package org.springframework.boot.system; diff --git a/spring-boot/src/test/java/org/springframework/boot/bind/PropertySourcesPropertyValuesTests.java b/spring-boot/src/test/java/org/springframework/boot/bind/PropertySourcesPropertyValuesTests.java index c84e12115b9..5a94321c05a 100644 --- a/spring-boot/src/test/java/org/springframework/boot/bind/PropertySourcesPropertyValuesTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/bind/PropertySourcesPropertyValuesTests.java @@ -237,7 +237,6 @@ public class PropertySourcesPropertyValuesTests { this.propertySources.addFirst(new MapPropertySource("s", second)); this.propertySources.addFirst(new MapPropertySource("f", first)); binder.bind(new PropertySourcesPropertyValues(this.propertySources)); - target.getList(); assertThat(target.getList()).hasSize(1); assertThat(target.getList().get(0).getDescription()) .isEqualTo("another description");