mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Source formatting and clean-up
This commit is contained in:
parent
40bf334871
commit
d039822064
@ -83,6 +83,7 @@ public class WebRequestTraceFilter implements Filter, Ordered {
|
||||
this.dumpRequests = dumpRequests;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
HttpServletRequest request = (HttpServletRequest) req;
|
||||
@ -133,9 +134,11 @@ public class WebRequestTraceFilter implements Filter, Ordered {
|
||||
return trace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.bootstrap.actuate.fixme;
|
||||
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*/
|
||||
|
@ -63,6 +63,7 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner,
|
||||
this.publisher = publisher;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws JobExecutionException {
|
||||
logger.info("Running default command line with: " + Arrays.asList(args));
|
||||
launchJobFromProperties(StringUtils.splitArrayElementsIntoProperties(args, "="));
|
||||
|
@ -29,7 +29,8 @@ public abstract class AstUtils {
|
||||
/**
|
||||
* Determine if an {@link AnnotatedNode} has one or more of the specified annotations.
|
||||
*/
|
||||
public static boolean hasAtLeastOneAnnotation(AnnotatedNode node, String... annotations) {
|
||||
public static boolean hasAtLeastOneAnnotation(AnnotatedNode node,
|
||||
String... annotations) {
|
||||
|
||||
for (AnnotationNode annotationNode : node.getAnnotations()) {
|
||||
for (String annotation : annotations) {
|
||||
|
@ -98,6 +98,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
|
||||
* @param contextPath the contextPath to set
|
||||
* @see #getContextPath
|
||||
*/
|
||||
@Override
|
||||
public void setContextPath(String contextPath) {
|
||||
Assert.notNull(contextPath, "ContextPath must not be null");
|
||||
if (contextPath.length() > 0) {
|
||||
@ -117,6 +118,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
|
||||
* Returns the context path for the embedded servlet container. The path will start
|
||||
* with "/" and not end with "/". The root context is represented by an empty string.
|
||||
*/
|
||||
@Override
|
||||
public String getContextPath() {
|
||||
return this.contextPath;
|
||||
}
|
||||
@ -127,6 +129,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
|
||||
*
|
||||
* @param port the port to set
|
||||
*/
|
||||
@Override
|
||||
public void setPort(int port) {
|
||||
if (port < 0 || port > 65535) {
|
||||
throw new IllegalArgumentException("Port must be between 1 and 65535");
|
||||
@ -137,6 +140,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
|
||||
/**
|
||||
* Returns the port that the embedded servlet container should listen on.
|
||||
*/
|
||||
@Override
|
||||
public int getPort() {
|
||||
return this.port;
|
||||
}
|
||||
@ -146,6 +150,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
|
||||
*
|
||||
* @param address the address to set (defaults to null)
|
||||
*/
|
||||
@Override
|
||||
public void setAddress(InetAddress address) {
|
||||
this.address = address;
|
||||
}
|
||||
@ -153,18 +158,20 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
|
||||
/**
|
||||
* @return the address the embedded container binds to
|
||||
*/
|
||||
@Override
|
||||
public InetAddress getAddress() {
|
||||
return this.address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets {@link ServletContextInitializer} that should be applied in addition to
|
||||
* {@link #getEmbeddedServletContainer(ServletContextInitializer...)} parameters.
|
||||
* This method will replace any previously set or added initializers.
|
||||
* {@link #getEmbeddedServletContainer(ServletContextInitializer...)} parameters. This
|
||||
* method will replace any previously set or added initializers.
|
||||
* @param initializers the initializers to set
|
||||
* @see #addInitializers
|
||||
* @see #getInitializers
|
||||
*/
|
||||
@Override
|
||||
public void setInitializers(List<? extends ServletContextInitializer> initializers) {
|
||||
Assert.notNull(initializers, "Initializers must not be null");
|
||||
this.initializers = new ArrayList<ServletContextInitializer>(initializers);
|
||||
|
@ -35,6 +35,7 @@ public abstract class SpringServletInitializer implements WebApplicationInitiali
|
||||
/** Logger available to subclasses. */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
@Override
|
||||
public void onStartup(ServletContext servletContext) throws ServletException {
|
||||
WebApplicationContext rootAppContext = this
|
||||
.createRootApplicationContext(servletContext);
|
||||
|
@ -52,7 +52,7 @@ import org.springframework.bootstrap.launcher.data.RandomAccessDataFile;
|
||||
|
||||
/**
|
||||
* Tests for {@link RandomAccessJarFile}.
|
||||
*
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
public class RandomAccessJarFileTest {
|
||||
|
@ -13,7 +13,8 @@ public class ProducerApplication implements CommandLineRunner {
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
new File("target/input").mkdirs();
|
||||
FileOutputStream stream = new FileOutputStream("target/input/data"+System.currentTimeMillis()+".txt");
|
||||
FileOutputStream stream = new FileOutputStream("target/input/data"
|
||||
+ System.currentTimeMillis() + ".txt");
|
||||
for (String arg : args) {
|
||||
stream.write(arg.getBytes());
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ public class NonAutoConfigurationBootstrapApplicationTests {
|
||||
private static ConfigurableApplicationContext context;
|
||||
|
||||
@Configuration
|
||||
@Import({ EmbeddedServletContainerAutoConfiguration.class, WebMvcAutoConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class })
|
||||
@Import({ EmbeddedServletContainerAutoConfiguration.class,
|
||||
WebMvcAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class })
|
||||
@ComponentScan(basePackageClasses = { SampleController.class, HelloWorldService.class })
|
||||
public static class NonAutoConfigurationBootstrapApplication {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user