Browse Source

Polish

pull/15325/head
Andy Wilkinson 7 years ago
parent
commit
2dc8f49f8a
  1. 1
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySource.java
  2. 5
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatEmbeddedContext.java
  3. 5
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java
  4. 5
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java
  5. 1
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateCustomizer.java
  6. 8
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrarTests.java
  7. 5
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java

1
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySource.java

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

5
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatEmbeddedContext.java

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

5
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java

@ -29,9 +29,6 @@ import javax.servlet.FilterRegistration; @@ -29,9 +29,6 @@ import javax.servlet.FilterRegistration;
import javax.servlet.FilterRegistration.Dynamic;
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.StringUtils;
@ -55,8 +52,6 @@ public abstract class AbstractFilterRegistrationBean<T extends Filter> @@ -55,8 +52,6 @@ public abstract class AbstractFilterRegistrationBean<T extends Filter>
@Deprecated
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 Set<ServletRegistrationBean<?>> servletRegistrationBeans = new LinkedHashSet<>();

5
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java

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

1
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateCustomizer.java

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

8
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrarTests.java

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

5
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java

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

Loading…
Cancel
Save