diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfigurationTests.java index 068dfd9bb7..689e3b7115 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfigurationTests.java @@ -47,7 +47,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests { @Test public void createFromConfigClass() { - this.contextRunner.withUserConfiguration(MockWebServerAutoConfiguration.class, + this.contextRunner.withUserConfiguration(MockWebServerConfiguration.class, HttpHandlerConfiguration.class).run((context) -> { assertThat(context.getBeansOfType(ReactiveWebServerFactory.class)) .hasSize(1); @@ -61,7 +61,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests { @Test public void missingHttpHandler() { - this.contextRunner.withUserConfiguration(MockWebServerAutoConfiguration.class) + this.contextRunner.withUserConfiguration(MockWebServerConfiguration.class) .run((context) -> assertThat(context.getStartupFailure()) .isInstanceOf(ApplicationContextException.class) .hasMessageContaining("missing HttpHandler bean")); @@ -70,7 +70,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests { @Test public void multipleHttpHandler() { this.contextRunner - .withUserConfiguration(MockWebServerAutoConfiguration.class, + .withUserConfiguration(MockWebServerConfiguration.class, HttpHandlerConfiguration.class, TooManyHttpHandlers.class) .run((context) -> assertThat(context.getStartupFailure()) .isInstanceOf(ApplicationContextException.class) @@ -80,7 +80,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests { @Test public void customizeReactiveWebServer() { - this.contextRunner.withUserConfiguration(MockWebServerAutoConfiguration.class, + this.contextRunner.withUserConfiguration(MockWebServerConfiguration.class, HttpHandlerConfiguration.class, ReactiveWebServerCustomization.class) .run((context) -> assertThat( context.getBean(MockReactiveWebServerFactory.class).getPort()) @@ -128,7 +128,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests { } @Configuration - public static class MockWebServerAutoConfiguration { + public static class MockWebServerConfiguration { @Bean public MockReactiveWebServerFactory mockReactiveWebServerFactory() { diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/OptionalLiveReloadServer.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/OptionalLiveReloadServer.java index 5474f4f611..de8e9fd642 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/OptionalLiveReloadServer.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/OptionalLiveReloadServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ public class OptionalLiveReloadServer implements InitializingBean { } /** - * Trigger LiveReload if the server is up an running. + * Trigger LiveReload if the server is up and running. */ public void triggerReload() { if (this.server != null) { diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 77998bfcc2..37e7992acd 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -782,7 +782,7 @@ content into your application. Rather, pick only the properties that you need. spring.jta.atomikos.datasource.xa-data-source-class-name= # Vendor-specific implementation of XAConnectionFactory. spring.jta.atomikos.datasource.xa-properties= # Vendor-specific XA properties. spring.jta.atomikos.properties.allow-sub-transactions=true # Specify whether sub-transactions are allowed. - spring.jta.atomikos.properties.checkpoint-interval=500 # Interval between checkpoints, expressed as the number of log writes between two checkpoint. + spring.jta.atomikos.properties.checkpoint-interval=500 # Interval between checkpoints, expressed as the number of log writes between two checkpoints. spring.jta.atomikos.properties.default-jta-timeout=10000ms # Default timeout for JTA transactions. spring.jta.atomikos.properties.default-max-wait-time-on-shutdown=9223372036854775807 # How long should normal shutdown (no-force) wait for transactions to complete. spring.jta.atomikos.properties.enable-logging=true # Whether to enable disk logging. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index e2c51807fc..575277664a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -1216,7 +1216,7 @@ If the `dev` profile is enabled, however, `map` contains two entries with keys ` (with a name of `dev name 1` and a description of `my description 1`) and `key2` (with a name of `dev name 2` and a description of `dev description 2`). -NOTE: The preceeding merging rules apply to properties from all property sources and not just +NOTE: The preceding merging rules apply to properties from all property sources and not just YAML files. [[boot-features-external-config-conversion]] diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/ApplicationConversionService.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/ApplicationConversionService.java index 4b78554df9..a5470427d9 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/ApplicationConversionService.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/ApplicationConversionService.java @@ -72,11 +72,11 @@ public class ApplicationConversionService extends FormattingConversionService { } /** - * Configure the given {@link FormatterRegistry} with formatters and converts + * Configure the given {@link FormatterRegistry} with formatters and converters * appropriate for most Spring Boot applications. * @param registry the registry of converters to add to (must also be castable to * ConversionService, e.g. being a {@link ConfigurableConversionService}) - * @throws ClassCastException if the given ConverterRegistry could not be cast to a + * @throws ClassCastException if the given FormatterRegistry could not be cast to a * ConversionService */ public static void configure(FormatterRegistry registry) { @@ -88,7 +88,6 @@ public class ApplicationConversionService extends FormattingConversionService { /** * Add converters useful for most Spring Boot applications. - * {@link DefaultConversionService#addDefaultConverters(ConverterRegistry)} * @param registry the registry of converters to add to (must also be castable to * ConversionService, e.g. being a {@link ConfigurableConversionService}) * @throws ClassCastException if the given ConverterRegistry could not be cast to a diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/CompressionCustomizer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/CompressionCustomizer.java index 2b898a6713..12a8e01863 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/CompressionCustomizer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/CompressionCustomizer.java @@ -32,7 +32,7 @@ import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; /** - * Configure the HTTP compression on an Reactor Netty request/response handler. + * Configure the HTTP compression on a Reactor Netty request/response handler. * * @author Stephane Maldini * @author Phillip Webb diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java index fc95df1264..decc89d440 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java @@ -85,16 +85,16 @@ class ApplicationBuilder { if (resourcesJar.exists()) { return resourcesJar; } - JarOutputStream resourcesJarStream = new JarOutputStream( - new FileOutputStream(resourcesJar)); - resourcesJarStream.putNextEntry(new ZipEntry("META-INF/resources/")); - resourcesJarStream.closeEntry(); - resourcesJarStream.putNextEntry( - new ZipEntry("META-INF/resources/nested-meta-inf-resource.txt")); - resourcesJarStream.write("nested".getBytes()); - resourcesJarStream.closeEntry(); - resourcesJarStream.close(); - return resourcesJar; + try (JarOutputStream resourcesJarStream = new JarOutputStream( + new FileOutputStream(resourcesJar))) { + resourcesJarStream.putNextEntry(new ZipEntry("META-INF/resources/")); + resourcesJarStream.closeEntry(); + resourcesJarStream.putNextEntry( + new ZipEntry("META-INF/resources/nested-meta-inf-resource.txt")); + resourcesJarStream.write("nested".getBytes()); + resourcesJarStream.closeEntry(); + return resourcesJar; + } } private void writePom(File appFolder, File resourcesJar) throws IOException { @@ -103,11 +103,12 @@ class ApplicationBuilder { context.put("container", this.container); context.put("bootVersion", Versions.getBootVersion()); context.put("resourcesJarPath", resourcesJar.getAbsolutePath()); - FileWriter out = new FileWriter(new File(appFolder, "pom.xml")); - Mustache.compiler().escapeHTML(false) - .compile(new FileReader("src/test/resources/pom-template.xml")) - .execute(context, out); - out.close(); + try (FileWriter out = new FileWriter(new File(appFolder, "pom.xml")); + FileReader templateReader = new FileReader("src/test/resources/pom-template.xml")) { + Mustache.compiler().escapeHTML(false) + .compile(templateReader) + .execute(context, out); + } } private File writeSettingsXml(File appFolder) throws IOException { @@ -118,9 +119,10 @@ class ApplicationBuilder { Map context = new HashMap<>(); context.put("repository", repository); File settingsXml = new File(appFolder, "settings.xml"); - try (FileWriter out = new FileWriter(settingsXml)) { + try (FileWriter out = new FileWriter(settingsXml); + FileReader templateReader = new FileReader("src/test/resources/settings-template.xml")) { Mustache.compiler().escapeHTML(false) - .compile(new FileReader("src/test/resources/settings-template.xml")) + .compile(templateReader) .execute(context, out); } return settingsXml;