Skip to content

Commit f73df2e

Browse files
committed
SpringServletContainerInitializer does not log WebApplicationInitializer class names
Issue: SPR-14213
1 parent bf7b475 commit f73df2e

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

spring-web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -113,18 +113,14 @@ public class SpringServletContainerInitializer implements ServletContainerInitia
113113
/**
114114
* Delegate the {@code ServletContext} to any {@link WebApplicationInitializer}
115115
* implementations present on the application classpath.
116-
*
117116
* <p>Because this class declares @{@code HandlesTypes(WebApplicationInitializer.class)},
118117
* Servlet 3.0+ containers will automatically scan the classpath for implementations
119118
* of Spring's {@code WebApplicationInitializer} interface and provide the set of all
120119
* such types to the {@code webAppInitializerClasses} parameter of this method.
121-
*
122-
* <p>If no {@code WebApplicationInitializer} implementations are found on the
123-
* classpath, this method is effectively a no-op. An INFO-level log message will be
124-
* issued notifying the user that the {@code ServletContainerInitializer} has indeed
125-
* been invoked but that no {@code WebApplicationInitializer} implementations were
126-
* found.
127-
*
120+
* <p>If no {@code WebApplicationInitializer} implementations are found on the classpath,
121+
* this method is effectively a no-op. An INFO-level log message will be issued notifying
122+
* the user that the {@code ServletContainerInitializer} has indeed been invoked but that
123+
* no {@code WebApplicationInitializer} implementations were found.
128124
* <p>Assuming that one or more {@code WebApplicationInitializer} types are detected,
129125
* they will be instantiated (and <em>sorted</em> if the @{@link
130126
* org.springframework.core.annotation.Order @Order} annotation is present or
@@ -134,7 +130,6 @@ public class SpringServletContainerInitializer implements ServletContainerInitia
134130
* that each instance may register and configure servlets such as Spring's
135131
* {@code DispatcherServlet}, listeners such as Spring's {@code ContextLoaderListener},
136132
* or any other Servlet API componentry such as filters.
137-
*
138133
* @param webAppInitializerClasses all implementations of
139134
* {@link WebApplicationInitializer} found on the application classpath
140135
* @param servletContext the servlet context to be initialized
@@ -168,9 +163,8 @@ public void onStartup(Set<Class<?>> webAppInitializerClasses, ServletContext ser
168163
return;
169164
}
170165

166+
servletContext.log(initializers.size() + " Spring WebApplicationInitializers detected on classpath");
171167
AnnotationAwareOrderComparator.sort(initializers);
172-
servletContext.log("Spring WebApplicationInitializers detected on classpath: " + initializers);
173-
174168
for (WebApplicationInitializer initializer : initializers) {
175169
initializer.onStartup(servletContext);
176170
}

0 commit comments

Comments
 (0)