pull/15325/head
Andy Wilkinson 6 years ago
parent dad6d4beca
commit 2dc8f49f8a

@ -30,6 +30,7 @@ import org.springframework.boot.origin.OriginTrackedValue;
* @see OriginTrackedValue * @see OriginTrackedValue
* @see #getConfigurationProperty(ConfigurationPropertyName) * @see #getConfigurationProperty(ConfigurationPropertyName)
*/ */
@FunctionalInterface
public interface ConfigurationPropertySource { public interface ConfigurationPropertySource {
/** /**

@ -61,9 +61,8 @@ class TomcatEmbeddedContext extends StandardContext {
} }
public void deferredLoadOnStartup() throws LifecycleException { public void deferredLoadOnStartup() throws LifecycleException {
doWithThreadContextClassLoader(getLoader().getClassLoader(), () -> { doWithThreadContextClassLoader(getLoader().getClassLoader(),
getLoadOnStartupWrappers(findChildren()).forEach(this::load); () -> getLoadOnStartupWrappers(findChildren()).forEach(this::load));
});
} }
private Stream<Wrapper> getLoadOnStartupWrappers(Container[] children) { private Stream<Wrapper> getLoadOnStartupWrappers(Container[] children) {

@ -29,9 +29,6 @@ import javax.servlet.FilterRegistration;
import javax.servlet.FilterRegistration.Dynamic; import javax.servlet.FilterRegistration.Dynamic;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@ -55,8 +52,6 @@ public abstract class AbstractFilterRegistrationBean<T extends Filter>
@Deprecated @Deprecated
protected static final int REQUEST_WRAPPER_FILTER_MAX_ORDER = 0; protected static final int REQUEST_WRAPPER_FILTER_MAX_ORDER = 0;
private final Log logger = LogFactory.getLog(getClass());
private static final String[] DEFAULT_URL_MAPPINGS = { "/*" }; private static final String[] DEFAULT_URL_MAPPINGS = { "/*" };
private Set<ServletRegistrationBean<?>> servletRegistrationBeans = new LinkedHashSet<>(); private Set<ServletRegistrationBean<?>> servletRegistrationBeans = new LinkedHashSet<>();

@ -26,9 +26,6 @@ import javax.servlet.Servlet;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
import javax.servlet.ServletRegistration; import javax.servlet.ServletRegistration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@ -54,8 +51,6 @@ import org.springframework.util.StringUtils;
public class ServletRegistrationBean<T extends Servlet> public class ServletRegistrationBean<T extends Servlet>
extends DynamicRegistrationBean<ServletRegistration.Dynamic> { extends DynamicRegistrationBean<ServletRegistration.Dynamic> {
private static final Log logger = LogFactory.getLog(ServletRegistrationBean.class);
private static final String[] DEFAULT_MAPPINGS = { "/*" }; private static final String[] DEFAULT_MAPPINGS = { "/*" };
private T servlet; private T servlet;

@ -24,6 +24,7 @@ import org.springframework.ws.client.core.WebServiceTemplate;
* @author Dmytro Nosan * @author Dmytro Nosan
* @since 2.1.0 * @since 2.1.0
*/ */
@FunctionalInterface
public interface WebServiceTemplateCustomizer { public interface WebServiceTemplateCustomizer {
/** /**

@ -85,11 +85,9 @@ public class ServletComponentScanRegistrarTests {
@Test @Test
public void packagesConfiguredWithBothValueAndBasePackages() { public void packagesConfiguredWithBothValueAndBasePackages() {
assertThatExceptionOfType(AnnotationConfigurationException.class) assertThatExceptionOfType(AnnotationConfigurationException.class)
.isThrownBy(() -> { .isThrownBy(() -> this.context = new AnnotationConfigApplicationContext(
this.context = new AnnotationConfigApplicationContext( ValueAndBasePackages.class))
ValueAndBasePackages.class); .withMessageContaining("'value'").withMessageContaining("'basePackages'")
}).withMessageContaining("'value'")
.withMessageContaining("'basePackages'")
.withMessageContaining("com.example.foo") .withMessageContaining("com.example.foo")
.withMessageContaining("com.example.bar"); .withMessageContaining("com.example.bar");
} }

@ -1049,9 +1049,8 @@ public abstract class AbstractServletWebServerFactoryTests {
@Test @Test
public void exceptionThrownOnLoadFailureIsRethrown() { public void exceptionThrownOnLoadFailureIsRethrown() {
AbstractServletWebServerFactory factory = getFactory(); AbstractServletWebServerFactory factory = getFactory();
this.webServer = factory.getWebServer((context) -> { this.webServer = factory.getWebServer((context) -> context
context.addServlet("failing", FailingServlet.class).setLoadOnStartup(0); .addServlet("failing", FailingServlet.class).setLoadOnStartup(0));
});
assertThatExceptionOfType(WebServerException.class) assertThatExceptionOfType(WebServerException.class)
.isThrownBy(this.webServer::start) .isThrownBy(this.webServer::start)
.satisfies(this::wrapsFailingServletException); .satisfies(this::wrapsFailingServletException);

Loading…
Cancel
Save