From 70adefc87bdfbec5d275d4887531a21a07fc0578 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Thu, 26 May 2016 21:04:32 +0900 Subject: [PATCH 1/2] Polish Closes gh-6046 --- .../src/main/asciidoc/autoconfig.adoc | 2 +- spring-boot-actuator-docs/src/main/asciidoc/index.adoc | 2 +- .../boot/autoconfigure/web/DefaultErrorViewResolver.java | 2 +- .../OnBeanConditionTypeDeductionFailureTests.java | 1 - .../template/TemplateAvailabilityProvidersTests.java | 2 +- .../main/asciidoc/appendix-application-properties.adoc | 2 +- .../src/main/asciidoc/appendix-executable-jar-format.adoc | 2 +- spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc | 2 +- .../src/main/asciidoc/spring-boot-features.adoc | 8 ++++---- .../boot/test/SpringBootMockServletContext.java | 2 +- .../boot/test/mock/web/SpringBootMockServletContext.java | 2 +- .../boot/test/web/client/TestRestTemplate.java | 2 +- .../additional-spring-configuration-metadata.json | 2 +- .../java/org/springframework/boot/ImageBannerTests.java | 1 - 14 files changed, 15 insertions(+), 17 deletions(-) diff --git a/spring-boot-actuator-docs/src/main/asciidoc/autoconfig.adoc b/spring-boot-actuator-docs/src/main/asciidoc/autoconfig.adoc index f8b0bec374..8d19eab253 100644 --- a/spring-boot-actuator-docs/src/main/asciidoc/autoconfig.adoc +++ b/spring-boot-actuator-docs/src/main/asciidoc/autoconfig.adoc @@ -1,6 +1,6 @@ === /autoconfig This endpoint is a report on the Spring Boot auto-configuration process that happened when -your application started up. It lists all the `@Conditional` annotations that were +your application started up. It lists all the `@Conditional` annotations that were evaluated as the context started and in each case it gives an indication of if (and why) the condition matched. A positive match results in a bean being included in the context, and a negative result means the opposite (the bean's class may not even be loaded). diff --git a/spring-boot-actuator-docs/src/main/asciidoc/index.adoc b/spring-boot-actuator-docs/src/main/asciidoc/index.adoc index 9f15bdb7ff..0dc1aa09bc 100644 --- a/spring-boot-actuator-docs/src/main/asciidoc/index.adoc +++ b/spring-boot-actuator-docs/src/main/asciidoc/index.adoc @@ -62,7 +62,7 @@ on the classpath by default) then the Actuator endpoint responses are enhanced w hypermedia in the form of "links". The default media type for responses is http://stateless.co/hal_specification.html[HAL], resulting in each resource having an extra property called "_links". You can change the media type to another one supported by -Spring HATEOAS by providing your own `@EnableHypermedia` annotation and custom providers +Spring HATEOAS by providing your own `@EnableHypermedia` annotation and custom providers as necessary. Example enhanced "/metrics" endpoint with additional "_links": diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/DefaultErrorViewResolver.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/DefaultErrorViewResolver.java index 02e3c2fa55..5e71cba1c4 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/DefaultErrorViewResolver.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/DefaultErrorViewResolver.java @@ -152,7 +152,7 @@ public class DefaultErrorViewResolver implements ErrorViewResolver, Ordered { } /** - * {@link View} backed by a HTML resource. + * {@link View} backed by an HTML resource. */ private static class HtmlResourceView implements View { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnBeanConditionTypeDeductionFailureTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnBeanConditionTypeDeductionFailureTests.java index 13d5434a59..272834d4a5 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnBeanConditionTypeDeductionFailureTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnBeanConditionTypeDeductionFailureTests.java @@ -49,7 +49,6 @@ public class OnBeanConditionTypeDeductionFailureTests { fail("Context refresh was successful"); } catch (Exception ex) { - ex.printStackTrace(); Throwable beanTypeDeductionException = findBeanTypeDeductionException(ex); assertThat(beanTypeDeductionException) .hasMessage("Failed to deduce bean type for " diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java index ea38f5da25..5a78135b35 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java @@ -196,7 +196,7 @@ public class TemplateAvailabilityProvidersTests { } @Test - public void getProvderWhenCacheDisabledShouldNotUseCache() throws Exception { + public void getProviderWhenCacheDisabledShouldNotUseCache() throws Exception { given(this.provider.isTemplateAvailable(this.view, this.environment, this.classLoader, this.resourceLoader)).willReturn(true); this.environment.setProperty("spring.template.provider.cache", "false"); diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 62be349e73..5d099a2949 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -31,7 +31,7 @@ content into your application; rather pick only the properties that you need. # BANNER banner.charset=UTF-8 # Banner file encoding. banner.location=classpath:banner.txt # Banner file location. - banner.image.location=classpath:banner.gif # (Banner image file location, jpg/png can also be used). + banner.image.location=classpath:banner.gif # Banner image file location (jpg/png can also be used). banner.image.width= # Width of the banner image in chars (default 76) banner.image.height= # Height of the banner image in chars (default based on image height) banner.image.margin= # Left hand image margin in chars (default 2) diff --git a/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc b/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc index 2268be8176..fd724aa9b6 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc @@ -97,7 +97,7 @@ a traditional web container should be placed in `WEB-INF/lib-provided`. The core class used to support loading nested jars is `org.springframework.boot.loader.jar.JarFile`. It allows you to load jar content from a standard jar file, or from nested child jar data. When first loaded, the -location of each `JarEntry` is mapped to a physical file offset of the outer jar: +location of each `JarEntry` is mapped to a physical file offset of the outer jar: [indent=0] ---- diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc index 6a93c67232..c6225833a6 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc @@ -228,7 +228,7 @@ For example, the following declaration: @DependencyManagementBom("com.example.custom-bom:1.0.0") ---- -Will pick up `custom-bom-1.0.0.pom` in a Maven repository under +Will pick up `custom-bom-1.0.0.pom` in a Maven repository under `com/example/custom-versions/1.0.0/`. When multiple BOMs are specified they are applied in the order that they're declared. 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 98ea69f4be..856912337e 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -52,7 +52,7 @@ such as the user that launched the application. The banner that is printed on start up can be changed by adding a `banner.txt` file to your classpath, or by setting `banner.location` to the location of such a file. If the file has an unusual encoding you can set `banner.charset` (default is `UTF-8`). -In addition a text file, you can also add a `banner.gif`, `banner.jpg` or `banner.png` +In addition to a text file, you can also add a `banner.gif`, `banner.jpg` or `banner.png` image file to your classpath, or set a `banner.image.location` property. Images will be converted into an ASCII art representation and printed above any text banner. @@ -1741,7 +1741,7 @@ this: +- ---- -To map all `5xx` errors using a freemarker template, you'd have a structure like this: +To map all `5xx` errors using a FreeMarker template, you'd have a structure like this: [source,indent=0,subs="verbatim,quotes,attributes"] ---- @@ -1750,7 +1750,7 @@ To map all `5xx` errors using a freemarker template, you'd have a structure like +- java/ | + +- resources/ - +- template/ + +- templates/ +- error/ | +- 5xx.ftl +- @@ -1786,7 +1786,7 @@ will then pick up any unhandled exceptions. For applications that aren't using Spring MVC, you can use the `ErrorPageRegistrar` interface to directly register `ErrorPages`. This abstraction works directly with the underlying embedded servlet container and will work even if you don't have a Spring MVC -`DispatcherServlet` +`DispatcherServlet`. [source,java,indent=0,subs="verbatim,quotes,attributes"] diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/SpringBootMockServletContext.java b/spring-boot-test/src/main/java/org/springframework/boot/test/SpringBootMockServletContext.java index 98b14eb5be..878f415a18 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/SpringBootMockServletContext.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/SpringBootMockServletContext.java @@ -20,7 +20,7 @@ import org.springframework.core.io.ResourceLoader; import org.springframework.mock.web.MockServletContext; /** - * {@link MockServletContext} implementation for Spring Boot. Respects well know Spring + * {@link MockServletContext} implementation for Spring Boot. Respects well-known Spring * Boot resource locations and uses an empty directory for "/" if no locations can be * found. * diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/web/SpringBootMockServletContext.java b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/web/SpringBootMockServletContext.java index 17aaee42ff..eb1a6de218 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/web/SpringBootMockServletContext.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/web/SpringBootMockServletContext.java @@ -27,7 +27,7 @@ import org.springframework.core.io.ResourceLoader; import org.springframework.mock.web.MockServletContext; /** - * {@link MockServletContext} implementation for Spring Boot. Respects well know Spring + * {@link MockServletContext} implementation for Spring Boot. Respects well-known Spring * Boot resource locations and uses an empty directory for "/" if no locations can be * found. * diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java b/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java index 91abccceab..5759c3790c 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java @@ -66,7 +66,7 @@ import org.springframework.web.util.UriTemplateHandler; * Apache Http Client 4.3.2 or better is available (recommended) it will be used as the * client, and by default configured to ignore cookies and redirects. *

- * Note: To prevent injection problems this class internationally does not extend + * Note: To prevent injection problems this class internally does not extend * {@link RestTemplate}. If you need access to the underlying {@link RestTemplate} use * {@link #getRestTemplate()}. * diff --git a/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 8bae435d42..e20386c903 100644 --- a/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -35,7 +35,7 @@ { "name": "banner.image.margin", "type": "java.lang.Integer", - "description": "Left hand image height (in chars)." + "description": "Left hand image margin (in chars)." }, { "name": "banner.image.invert", diff --git a/spring-boot/src/test/java/org/springframework/boot/ImageBannerTests.java b/spring-boot/src/test/java/org/springframework/boot/ImageBannerTests.java index fdcc12f6a8..f6b8df6dc0 100644 --- a/spring-boot/src/test/java/org/springframework/boot/ImageBannerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/ImageBannerTests.java @@ -121,7 +121,6 @@ public class ImageBannerTests { AnsiOutput.setEnabled(AnsiOutput.Enabled.NEVER); String banner = printBanner("gradient.gif", "banner.image.width=10", "banner.image.margin=0"); - System.out.println(banner); assertThat(banner).contains("@#8&o:*. "); } From deb6c9a4f66c5624c02cb0d2512d8b92ac0b1c14 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 26 May 2016 14:57:50 +0200 Subject: [PATCH 2/2] Polish --- .../META-INF/additional-spring-configuration-metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json index e20386c903..1be88f3331 100644 --- a/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -19,7 +19,7 @@ { "name": "banner.image.location", "type": "org.springframework.core.io.Resource", - "description": "Banner image file location.", + "description": "Banner image file location (jpg/png can also be used).", "defaultValue": "banner.gif" }, {