diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfiguration.java index 4a791db7b0f..235486b2af0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfiguration.java @@ -78,11 +78,9 @@ public class JerseyServerMetricsAutoConfiguration { public ResourceConfigCustomizer jerseyServerMetricsResourceConfigCustomizer( MeterRegistry meterRegistry, JerseyTagsProvider tagsProvider) { Server server = this.properties.getWeb().getServer(); - return (config) -> { - config.register(new MetricsApplicationEventListener(meterRegistry, - tagsProvider, server.getRequestsMetricName(), - server.isAutoTimeRequests(), new AnnotationUtilsAnnotationFinder())); - }; + return (config) -> config.register(new MetricsApplicationEventListener( + meterRegistry, tagsProvider, server.getRequestsMetricName(), + server.isAutoTimeRequests(), new AnnotationUtilsAnnotationFinder())); } @Bean diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/StepRegistryPropertiesTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/StepRegistryPropertiesTests.java index 3d7144d88b8..25af792ceda 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/StepRegistryPropertiesTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/StepRegistryPropertiesTests.java @@ -28,6 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat; */ public abstract class StepRegistryPropertiesTests { + @SuppressWarnings("deprecation") protected void assertStepRegistryDefaultValues(StepRegistryProperties properties, StepRegistryConfig config) { assertThat(properties.getStep()).isEqualTo(config.step()); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java index 9ce083fa607..7c8f5939049 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java @@ -102,9 +102,8 @@ public class TomcatMetricsAutoConfigurationTests { .withConfiguration( AutoConfigurations.of(TomcatMetricsAutoConfiguration.class)) .withUserConfiguration(MeterRegistryConfiguration.class) - .run((context) -> { - assertThat(context).hasSingleBean(TomcatMetricsBinder.class); - }); + .run((context) -> assertThat(context) + .hasSingleBean(TomcatMetricsBinder.class)); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java index 308e5e123a0..ead53099c06 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java @@ -40,7 +40,7 @@ import org.springframework.http.converter.support.AllEncompassingFormHttpMessage * {@link ApplicationListener} to trigger early initialization in a background thread of * time consuming tasks. *

- * Set the {@value IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAME} system property to + * Set the {@link #IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAME} system property to * {@code true} to disable this mechanism and let such initialization happen in the * foreground. * diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java index 265209c15a2..444b5c0eec5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java @@ -168,6 +168,7 @@ public class MongoDataAutoConfiguration { } @Override + @Deprecated public DB getLegacyDb() { return this.mongoDbFactory.getLegacyDb(); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/package-info.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/package-info.java new file mode 100644 index 00000000000..a95cd89dd04 --- /dev/null +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/package-info.java @@ -0,0 +1,21 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Internal {@link org.springframework.boot.diagnostics.FailureAnalyzer} implementations + * related to auto-configuration. + */ +package org.springframework.boot.autoconfigure.diagnostics.analyzer; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbOkHttpClientBuilderProvider.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbOkHttpClientBuilderProvider.java index 9a01b92e708..4f8d7c06ea2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbOkHttpClientBuilderProvider.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbOkHttpClientBuilderProvider.java @@ -22,8 +22,8 @@ import okhttp3.OkHttpClient; import org.influxdb.InfluxDB; /** - * Provide the {@link OkHttpClient.Builder} to use to customize the auto-configured - * {@link InfluxDB} instance. + * Provide the {@link okhttp3.OkHttpClient.Builder OkHttpClient.Builder} to use to + * customize the auto-configured {@link InfluxDB} instance. * * @author Stephane Nicoll * @since 2.1.0 diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java index 7126ab2312b..b46b437e5c8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java @@ -22,7 +22,7 @@ import javax.transaction.TransactionManager; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.BeanClassLoaderAware; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; @@ -61,17 +61,21 @@ import org.springframework.util.StringUtils; @ConditionalOnMissingBean(DataSource.class) public class XADataSourceAutoConfiguration implements BeanClassLoaderAware { - @Autowired - private XADataSourceWrapper wrapper; + private final XADataSourceWrapper wrapper; - @Autowired - private DataSourceProperties properties; + private final DataSourceProperties properties; - @Autowired(required = false) - private XADataSource xaDataSource; + private final XADataSource xaDataSource; private ClassLoader classLoader; + public XADataSourceAutoConfiguration(XADataSourceWrapper wrapper, + DataSourceProperties properties, ObjectProvider xaDataSource) { + this.wrapper = wrapper; + this.properties = properties; + this.xaDataSource = xaDataSource.getIfAvailable(); + } + @Bean public DataSource dataSource() throws Exception { XADataSource xaDataSource = this.xaDataSource; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java index fa065c49e68..db6ba9a8e53 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java @@ -29,8 +29,10 @@ import org.junit.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; +import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.test.util.ReflectionTestUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; @@ -59,10 +61,8 @@ public class MongoReactiveAutoConfigurationTests { public void optionsAdded() { this.contextRunner.withPropertyValues("spring.data.mongodb.host:localhost") .withUserConfiguration(OptionsConfig.class) - .run((context) -> assertThat( - context.getBean(MongoClient.class).getSettings() - .getSocketSettings().getReadTimeout(TimeUnit.SECONDS)) - .isEqualTo(300)); + .run((context) -> assertThat(getSettings(context).getSocketSettings() + .getReadTimeout(TimeUnit.SECONDS)).isEqualTo(300)); } @Test @@ -70,9 +70,8 @@ public class MongoReactiveAutoConfigurationTests { this.contextRunner .withPropertyValues("spring.data.mongodb.uri:mongodb://localhost/test") .withUserConfiguration(OptionsConfig.class) - .run((context) -> assertThat(context.getBean(MongoClient.class) - .getSettings().getReadPreference()) - .isEqualTo(ReadPreference.nearest())); + .run((context) -> assertThat(getSettings(context).getReadPreference()) + .isEqualTo(ReadPreference.nearest())); } @Test @@ -81,9 +80,7 @@ public class MongoReactiveAutoConfigurationTests { .withPropertyValues("spring.data.mongodb.uri:mongodb://localhost/test") .withUserConfiguration(SslOptionsConfig.class).run((context) -> { assertThat(context).hasSingleBean(MongoClient.class); - MongoClient mongo = context.getBean(MongoClient.class); - com.mongodb.async.client.MongoClientSettings settings = mongo - .getSettings(); + MongoClientSettings settings = getSettings(context); assertThat(settings.getApplicationName()).isEqualTo("test-config"); assertThat(settings.getStreamFactoryFactory()) .isSameAs(context.getBean("myStreamFactoryFactory")); @@ -94,9 +91,8 @@ public class MongoReactiveAutoConfigurationTests { public void nettyStreamFactoryFactoryIsConfiguredAutomatically() { this.contextRunner.run((context) -> { assertThat(context).hasSingleBean(MongoClient.class); - assertThat(context.getBean(MongoClient.class).getSettings() - .getStreamFactoryFactory()) - .isInstanceOf(NettyStreamFactoryFactory.class); + assertThat(getSettings(context).getStreamFactoryFactory()) + .isInstanceOf(NettyStreamFactoryFactory.class); }); } @@ -106,14 +102,21 @@ public class MongoReactiveAutoConfigurationTests { "spring.data.mongodb.uri:mongodb://localhost/test?appname=auto-config") .withUserConfiguration(SimpleCustomizerConfig.class).run((context) -> { assertThat(context).hasSingleBean(MongoClient.class); - MongoClient client = context.getBean(MongoClient.class); - assertThat(client.getSettings().getApplicationName()) + MongoClientSettings settings = getSettings(context); + assertThat(settings.getApplicationName()) .isEqualTo("overridden-name"); - assertThat(client.getSettings().getStreamFactoryFactory()) + assertThat(settings.getStreamFactoryFactory()) .isEqualTo(SimpleCustomizerConfig.streamFactoryFactory); }); } + @SuppressWarnings("deprecation") + private MongoClientSettings getSettings(ApplicationContext context) { + MongoClient client = context.getBean(MongoClient.class); + return (MongoClientSettings) ReflectionTestUtils.getField(client.getSettings(), + "wrapped"); + } + @Configuration static class OptionsConfig { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/ReactiveMongoClientFactoryTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/ReactiveMongoClientFactoryTests.java index 712a3cb6ab4..fa72b9c863c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/ReactiveMongoClientFactoryTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/ReactiveMongoClientFactoryTests.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.springframework.core.env.Environment; import org.springframework.mock.env.MockEnvironment; +import org.springframework.test.util.ReflectionTestUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalStateException; @@ -113,7 +114,7 @@ public class ReactiveMongoClientFactoryTests { MongoProperties properties = new MongoProperties(); properties.setUri("mongodb://localhost/test?retryWrites=true"); MongoClient client = createMongoClient(properties); - assertThat(client.getSettings().getRetryWrites()).isTrue(); + assertThat(getSettings(client).getRetryWrites()).isTrue(); } @Test @@ -190,14 +191,19 @@ public class ReactiveMongoClientFactoryTests { } private List extractServerAddresses(MongoClient client) { - com.mongodb.async.client.MongoClientSettings settings = client.getSettings(); + MongoClientSettings settings = getSettings(client); ClusterSettings clusterSettings = settings.getClusterSettings(); return clusterSettings.getHosts(); } private MongoCredential extractMongoCredentials(MongoClient client) { - com.mongodb.async.client.MongoClientSettings settings = client.getSettings(); - return settings.getCredential(); + return getSettings(client).getCredential(); + } + + @SuppressWarnings("deprecation") + private MongoClientSettings getSettings(MongoClient client) { + return (MongoClientSettings) ReflectionTestUtils.getField(client.getSettings(), + "wrapped"); } private void assertServerAddress(ServerAddress serverAddress, String expectedHost, diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java index af4fc3d2060..a3696292204 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java @@ -512,13 +512,11 @@ public class WebMvcAutoConfigurationTests { this.contextRunner.withUserConfiguration(CustomAsyncTaskExecutorConfigurer.class) .withConfiguration( AutoConfigurations.of(TaskExecutionAutoConfiguration.class)) - .run((context) -> { - assertThat(ReflectionTestUtils.getField( - context.getBean(RequestMappingHandlerAdapter.class), - "taskExecutor")) - .isSameAs(context.getBean( - CustomAsyncTaskExecutorConfigurer.class).taskExecutor); - }); + .run((context) -> assertThat(ReflectionTestUtils.getField( + context.getBean(RequestMappingHandlerAdapter.class), + "taskExecutor")) + .isSameAs(context.getBean( + CustomAsyncTaskExecutorConfigurer.class).taskExecutor)); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java index f91b431d681..22f3b307e8e 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java @@ -23,7 +23,6 @@ import javax.servlet.Filter; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -108,11 +107,15 @@ public class RemoteDevToolsAutoConfiguration { @ConditionalOnProperty(prefix = "spring.devtools.remote.restart", name = "enabled", matchIfMissing = true) static class RemoteRestartConfiguration { - @Autowired - private DevToolsProperties properties; + private final DevToolsProperties properties; - @Autowired - private ServerProperties serverProperties; + private final ServerProperties serverProperties; + + RemoteRestartConfiguration(DevToolsProperties devToolsProperties, + ServerProperties serverProperties) { + this.properties = devToolsProperties; + this.serverProperties = serverProperties; + } @Bean @ConditionalOnMissingBean diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/logger/package-info.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/logger/package-info.java new file mode 100644 index 00000000000..1edc3b2f3fc --- /dev/null +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/logger/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Devtools specific logging concerns. + */ +package org.springframework.boot.devtools.logger; diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/RemoteClientConfiguration.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/RemoteClientConfiguration.java index 4e1acd6a5df..7ba4ec3dfa6 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/RemoteClientConfiguration.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/RemoteClientConfiguration.java @@ -28,7 +28,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -75,11 +75,12 @@ public class RemoteClientConfiguration implements InitializingBean { private final DevToolsProperties properties; - @Value("${remoteUrl}") - private String remoteUrl; + private final String remoteUrl; - public RemoteClientConfiguration(DevToolsProperties properties) { + public RemoteClientConfiguration(DevToolsProperties properties, + @Value("${remoteUrl}") String remoteUrl) { this.properties = properties; + this.remoteUrl = remoteUrl; } @Bean @@ -134,20 +135,25 @@ public class RemoteClientConfiguration implements InitializingBean { static class LiveReloadConfiguration implements ApplicationListener { - @Autowired - private DevToolsProperties properties; + private final DevToolsProperties properties; - @Autowired(required = false) - private LiveReloadServer liveReloadServer; + private final LiveReloadServer liveReloadServer; - @Autowired - private ClientHttpRequestFactory clientHttpRequestFactory; + private final ClientHttpRequestFactory clientHttpRequestFactory; @Value("${remoteUrl}") private String remoteUrl; private ExecutorService executor = Executors.newSingleThreadExecutor(); + LiveReloadConfiguration(DevToolsProperties properties, + ObjectProvider liveReloadServer, + ClientHttpRequestFactory clientHttpRequestFactory) { + this.properties = properties; + this.liveReloadServer = liveReloadServer.getIfAvailable(); + this.clientHttpRequestFactory = clientHttpRequestFactory; + } + @Bean @RestartScope @ConditionalOnMissingBean @@ -181,11 +187,15 @@ public class RemoteClientConfiguration implements InitializingBean { @ConditionalOnProperty(prefix = "spring.devtools.remote.restart", name = "enabled", matchIfMissing = true) static class RemoteRestartClientConfiguration { - @Autowired - private DevToolsProperties properties; + private final DevToolsProperties properties; - @Value("${remoteUrl}") - private String remoteUrl; + private final String remoteUrl; + + RemoteRestartClientConfiguration(DevToolsProperties properties, + @Value("${remoteUrl}") String remoteUrl) { + this.properties = properties; + this.remoteUrl = remoteUrl; + } @Bean public ClassPathFileSystemWatcher classPathFileSystemWatcher() { diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java index f2b31a1352a..09b96930eac 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java @@ -111,12 +111,13 @@ public class SpringBootMockMvcBuilderCustomizer implements MockMvcBuilderCustomi FilterRegistrationBeans registrations = new FilterRegistrationBeans(this.context); registrations.stream().map(AbstractFilterRegistrationBean.class::cast) .filter(AbstractFilterRegistrationBean::isEnabled) - .forEach((registration) -> addFilter(builder, registration.getFilter(), - registration.getUrlPatterns())); + .forEach((registration) -> addFilter(builder, registration)); } - private void addFilter(ConfigurableMockMvcBuilder builder, Filter filter, - Collection urls) { + private void addFilter(ConfigurableMockMvcBuilder builder, + AbstractFilterRegistrationBean registration) { + Filter filter = registration.getFilter(); + Collection urls = registration.getUrlPatterns(); if (urls.isEmpty()) { builder.addFilters(filter); } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/package-info.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/package-info.java new file mode 100644 index 00000000000..2892764f307 --- /dev/null +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Web test utilities and support classes. + */ +package org.springframework.boot.test.web; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/package-info.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/package-info.java new file mode 100644 index 00000000000..710a2e53120 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Field value parsing for the standard Java compiler. + */ +package org.springframework.boot.configurationprocessor.fieldvalues.javac; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/package-info.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/package-info.java new file mode 100644 index 00000000000..df7a966ce15 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Abstraction for field value parsing. + */ +package org.springframework.boot.configurationprocessor.fieldvalues; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/package-info.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/package-info.java new file mode 100644 index 00000000000..d10e28f5306 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The configuration properties meta-data model and JSON writing support. + */ +package org.springframework.boot.configurationprocessor.metadata; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/package-info.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/package-info.java new file mode 100644 index 00000000000..db8ed5833e8 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Annotation processor to create {@code @ConfigurationProperties} meta-data files. + */ +package org.springframework.boot.configurationprocessor; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/ZipInflaterInputStream.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/ZipInflaterInputStream.java index 46d9600ea06..c46f9776255 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/ZipInflaterInputStream.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/ZipInflaterInputStream.java @@ -35,10 +35,6 @@ class ZipInflaterInputStream extends InflaterInputStream { private boolean extraBytesWritten; ZipInflaterInputStream(InputStream inputStream, int size) { - this(inputStream, new Inflater(true), size); - } - - private ZipInflaterInputStream(InputStream inputStream, Inflater inflater, int size) { super(inputStream, new Inflater(true), getInflaterBufferSize(size)); this.available = size; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/package-info.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/package-info.java new file mode 100644 index 00000000000..23a08a72094 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Maven plugin for Spring Boot. + */ +package org.springframework.boot.maven; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java index e76b40d2873..502497afbb2 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java @@ -136,7 +136,7 @@ public abstract class AbstractReactiveWebServerFactoryTests { SslContextBuilder builder = SslContextBuilder.forClient() .sslProvider(SslProvider.JDK) .trustManager(InsecureTrustManagerFactory.INSTANCE); - HttpClient client = HttpClient.create().wiretap() + HttpClient client = HttpClient.create().wiretap(true) .secure((sslContextSpec) -> sslContextSpec.sslContext(builder)); return new ReactorClientHttpConnector(client); } @@ -174,7 +174,7 @@ public abstract class AbstractReactiveWebServerFactoryTests { .sslProvider(SslProvider.JDK) .trustManager(InsecureTrustManagerFactory.INSTANCE) .keyManager(clientKeyManagerFactory); - HttpClient client = HttpClient.create().wiretap() + HttpClient client = HttpClient.create().wiretap(true) .secure((sslContextSpec) -> sslContextSpec.sslContext(builder)); return new ReactorClientHttpConnector(client); } @@ -232,7 +232,7 @@ public abstract class AbstractReactiveWebServerFactoryTests { } protected WebClient.Builder getWebClient() { - return getWebClient(HttpClient.create().wiretap()); + return getWebClient(HttpClient.create().wiretap(true)); } protected WebClient.Builder getWebClient(HttpClient client) { @@ -304,10 +304,11 @@ public abstract class AbstractReactiveWebServerFactoryTests { .getWebServer(new CharsHandler(3000, MediaType.TEXT_PLAIN)); this.webServer.start(); - HttpClient client = HttpClient.create().wiretap().compress(true).tcpConfiguration( - (tcpClient) -> tcpClient.doOnConnected((connection) -> connection - .channel().pipeline().addBefore(NettyPipeline.HttpDecompressor, - "CompressionTest", new CompressionDetectionHandler()))); + HttpClient client = HttpClient.create().wiretap(true).compress(true) + .tcpConfiguration((tcpClient) -> tcpClient.doOnConnected( + (connection) -> connection.channel().pipeline().addBefore( + NettyPipeline.HttpDecompressor, "CompressionTest", + new CompressionDetectionHandler()))); return getWebClient(client).build(); } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/src/main/java/sample/package-info.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/src/main/java/sample/package-info.java new file mode 100644 index 00000000000..1491da7312f --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/src/main/java/sample/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Sample used for testing. + */ +package sample;