diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java index 07114618d78..2907591d318 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java @@ -229,18 +229,6 @@ public class EndpointMBeanExporter extends MBeanExporter * @return an adapted endpoint */ protected JmxEndpoint adaptEndpoint(String beanName, Endpoint endpoint) { - return getEndpointMBean(beanName, endpoint); - } - - /** - * Get a {@link EndpointMBean} for the specified {@link Endpoint}. - * @param beanName the bean name - * @param endpoint the endpoint - * @return an {@link EndpointMBean} - * @deprecated as of 1.5 in favor of {@link #adaptEndpoint(String, Endpoint)} - */ - @Deprecated - protected EndpointMBean getEndpointMBean(String beanName, Endpoint endpoint) { if (endpoint instanceof ShutdownEndpoint) { return new ShutdownEndpointMBean(beanName, endpoint, this.objectMapper); } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java index 6013b5de06d..4a8ee9026e7 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java @@ -106,6 +106,11 @@ public class AutoConfigurationImportSelector } protected boolean isEnabled(AnnotationMetadata metadata) { + if (getClass().equals(AutoConfigurationImportSelector.class)) { + return getEnvironment().getProperty( + EnableAutoConfiguration.ENABLED_OVERRIDE_PROPERTY, Boolean.class, + true); + } return true; } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java index 4253a81d3da..5c416550ec9 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java @@ -73,7 +73,7 @@ import org.springframework.core.io.support.SpringFactoriesLoader; @Documented @Inherited @AutoConfigurationPackage -@Import(EnableAutoConfigurationImportSelector.class) +@Import(AutoConfigurationImportSelector.class) public @interface EnableAutoConfiguration { String ENABLED_OVERRIDE_PROPERTY = "spring.boot.enableautoconfiguration"; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfigurationImportSelector.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfigurationImportSelector.java deleted file mode 100644 index 50fcb11ed31..00000000000 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfigurationImportSelector.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012-2017 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. - */ - -package org.springframework.boot.autoconfigure; - -import org.springframework.context.annotation.DeferredImportSelector; -import org.springframework.core.type.AnnotationMetadata; - -/** - * {@link DeferredImportSelector} to handle {@link EnableAutoConfiguration - * auto-configuration}. This class can also be subclassed if a custom variant of - * {@link EnableAutoConfiguration @EnableAutoConfiguration}. is needed. - * - * @deprecated as of 1.5 in favor of {@link AutoConfigurationImportSelector} - * @author Phillip Webb - * @author Andy Wilkinson - * @author Stephane Nicoll - * @author Madhura Bhave - * @since 1.3.0 - * @see EnableAutoConfiguration - */ -@Deprecated -public class EnableAutoConfigurationImportSelector - extends AutoConfigurationImportSelector { - - @Override - protected boolean isEnabled(AnnotationMetadata metadata) { - if (getClass().equals(EnableAutoConfigurationImportSelector.class)) { - return getEnvironment().getProperty( - EnableAutoConfiguration.ENABLED_OVERRIDE_PROPERTY, Boolean.class, - true); - } - return true; - } - -} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java deleted file mode 100644 index 71cc0617b84..00000000000 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2012-2017 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. - */ - -package org.springframework.boot.autoconfigure; - -import org.springframework.context.MessageSource; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.ImportSelector; -import org.springframework.core.Ordered; -import org.springframework.core.type.AnnotationMetadata; - -/** - * {@link EnableAutoConfiguration Auto-configuration} for {@link MessageSource}. - * - * @author Dave Syer - * @author Phillip Webb - * @author EddĂș MelĂ©ndez - * @deprecated as of 1.5 in favor of - * {@link org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration} - */ -@Configuration -@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) -@Deprecated -@Import(MessageSourceAutoConfiguration.Selector.class) -public class MessageSourceAutoConfiguration { - - private static final String[] REPLACEMENT = { - "org.springframework.boot.autoconfigure.context." - + "MessageSourceAutoConfiguration" }; - - static class Selector implements ImportSelector { - - @Override - public String[] selectImports(AnnotationMetadata importingClassMetadata) { - return REPLACEMENT; - } - - } - -} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfiguration.java deleted file mode 100644 index 70a2da95c1b..00000000000 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfiguration.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2012-2017 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. - */ - -package org.springframework.boot.autoconfigure; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.ImportSelector; -import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; -import org.springframework.core.Ordered; -import org.springframework.core.type.AnnotationMetadata; - -/** - * {@link EnableAutoConfiguration Auto-configuration} for - * {@link PropertySourcesPlaceholderConfigurer}. - * - * @author Phillip Webb - * @author Dave Syer - * @deprecated as of 1.5 in favor of - * {@link org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration} - */ -@Configuration -@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) -@Deprecated -@Import(PropertyPlaceholderAutoConfiguration.Selector.class) -public class PropertyPlaceholderAutoConfiguration { - - private static final String[] REPLACEMENT = { - "org.springframework.boot.autoconfigure.context." - + "PropertyPlaceholderAutoConfiguration" }; - - static class Selector implements ImportSelector { - - @Override - public String[] selectImports(AnnotationMetadata importingClassMetadata) { - return REPLACEMENT; - } - - } - -} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 04f90a2f31d..3e5eae2a356 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -29,7 +29,6 @@ import java.util.Set; import java.util.TimeZone; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.boot.web.server.Compression; import org.springframework.boot.web.server.Ssl; @@ -1115,12 +1114,6 @@ public class ServerProperties { */ private Integer bufferSize; - /** - * Number of buffer per region. - */ - @Deprecated - private Integer buffersPerRegion; - /** * Number of I/O threads to create for the worker. */ @@ -1154,15 +1147,6 @@ public class ServerProperties { this.bufferSize = bufferSize; } - @DeprecatedConfigurationProperty(reason = "The property is not used by Undertow. See https://issues.jboss.org/browse/UNDERTOW-587 for details") - public Integer getBuffersPerRegion() { - return this.buffersPerRegion; - } - - public void setBuffersPerRegion(Integer buffersPerRegion) { - this.buffersPerRegion = buffersPerRegion; - } - public Integer getIoThreads() { return this.ioThreads; } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/EnableAutoConfigurationImportSelectorTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/EnableAutoConfigurationImportSelectorTests.java deleted file mode 100644 index acfae2caef9..00000000000 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/EnableAutoConfigurationImportSelectorTests.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2012-2017 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. - */ - -package org.springframework.boot.autoconfigure; - -import org.junit.Before; -import org.junit.Test; - -import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; -import org.springframework.core.io.DefaultResourceLoader; -import org.springframework.core.type.StandardAnnotationMetadata; -import org.springframework.mock.env.MockEnvironment; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link EnableAutoConfigurationImportSelector} - * - * @author Andy Wilkinson - * @author Stephane Nicoll - * @author Madhura Bhave - */ -@SuppressWarnings("deprecation") -public class EnableAutoConfigurationImportSelectorTests { - - private final EnableAutoConfigurationImportSelector importSelector = new EnableAutoConfigurationImportSelector(); - - private final ConfigurableListableBeanFactory beanFactory = new DefaultListableBeanFactory(); - - private final MockEnvironment environment = new MockEnvironment(); - - @Before - public void setup() { - this.importSelector.setBeanFactory(this.beanFactory); - this.importSelector.setEnvironment(this.environment); - this.importSelector.setResourceLoader(new DefaultResourceLoader()); - } - - @Test - public void propertyOverrideSetToTrue() throws Exception { - this.environment.setProperty(EnableAutoConfiguration.ENABLED_OVERRIDE_PROPERTY, - "true"); - String[] imports = selectImports(BasicEnableAutoConfiguration.class); - assertThat(imports).isNotEmpty(); - } - - @Test - public void propertyOverrideSetToFalse() throws Exception { - this.environment.setProperty(EnableAutoConfiguration.ENABLED_OVERRIDE_PROPERTY, - "false"); - String[] imports = selectImports(BasicEnableAutoConfiguration.class); - assertThat(imports).isEmpty(); - } - - private String[] selectImports(Class source) { - return this.importSelector.selectImports(new StandardAnnotationMetadata(source)); - } - - @EnableAutoConfiguration - private class BasicEnableAutoConfiguration { - - } - -} diff --git a/spring-boot/src/main/java/org/springframework/boot/context/event/ApplicationStartedEvent.java b/spring-boot/src/main/java/org/springframework/boot/context/event/ApplicationStartedEvent.java deleted file mode 100644 index 0fe49095df9..00000000000 --- a/spring-boot/src/main/java/org/springframework/boot/context/event/ApplicationStartedEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012-2016 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. - */ - -package org.springframework.boot.context.event; - -import org.springframework.boot.SpringApplication; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationListener; -import org.springframework.core.env.Environment; - -/** - * Event published as early as conceivably possible as soon as a {@link SpringApplication} - * has been started - before the {@link Environment} or {@link ApplicationContext} is - * available, but after the {@link ApplicationListener}s have been registered. The source - * of the event is the {@link SpringApplication} itself, but beware of using its internal - * state too much at this early stage since it might be modified later in the lifecycle. - * - * @author Dave Syer - * @deprecated as of 1.5 in favor of {@link ApplicationStartingEvent} - */ -@Deprecated -@SuppressWarnings("serial") -public class ApplicationStartedEvent extends ApplicationStartingEvent { - - /** - * Create a new {@link ApplicationStartedEvent} instance. - * @param application the current application - * @param args the arguments the application is running with - */ - public ApplicationStartedEvent(SpringApplication application, String[] args) { - super(application, args); - } - -} diff --git a/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java b/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java index 695c819d92c..f0b2826f4b5 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java @@ -65,7 +65,7 @@ public class EventPublishingRunListener implements SpringApplicationRunListener, @SuppressWarnings("deprecation") public void starting() { this.initialMulticaster - .multicastEvent(new ApplicationStartedEvent(this.application, this.args)); + .multicastEvent(new ApplicationStartingEvent(this.application, this.args)); } @Override diff --git a/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java b/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java index d57b959e1b8..493e94c9852 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java @@ -544,18 +544,6 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto this.baseDirectory = baseDirectory; } - /** - * A comma-separated list of jars to ignore for TLD scanning. See Tomcat's - * catalina.properties for typical values. Defaults to a list drawn from that source. - * @param tldSkip the jars to skip when scanning for TLDs etc - * @deprecated as of 1.5 in favor of {@link #setTldSkipPatterns(Collection)} - */ - @Deprecated - public void setTldSkip(String tldSkip) { - Assert.notNull(tldSkip, "TldSkip must not be null"); - setTldSkipPatterns(StringUtils.commaDelimitedListToSet(tldSkip)); - } - /** * Returns a mutable set of the patterns that match jars to ignore for TLD scanning. * @return the list of jars to ignore for TLD scanning diff --git a/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java b/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java index 25d5b6d4876..be6245e4d00 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java @@ -580,11 +580,6 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac this.bufferSize = bufferSize; } - @Deprecated - public void setBuffersPerRegion(Integer buffersPerRegion) { - - } - public void setIoThreads(Integer ioThreads) { this.ioThreads = ioThreads; } diff --git a/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index 7655e4a6ff9..575358c705b 100644 --- a/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -377,8 +377,6 @@ public class SpringApplicationTests { application.addListeners(new ApplicationRunningEventListener()); this.context = application.run(); assertThat(events).hasSize(5); - assertThat(events.get(0)).isInstanceOf( - org.springframework.boot.context.event.ApplicationStartedEvent.class); assertThat(events.get(0)).isInstanceOf(ApplicationStartingEvent.class); assertThat(events.get(1)).isInstanceOf(ApplicationEnvironmentPreparedEvent.class); assertThat(events.get(2)).isInstanceOf(ApplicationPreparedEvent.class);