Source formatting and clean-up

pull/7/head
Phillip Webb 12 years ago
parent 40bf334871
commit d039822064

@ -83,6 +83,7 @@ public class WebRequestTraceFilter implements Filter, Ordered {
this.dumpRequests = dumpRequests; this.dumpRequests = dumpRequests;
} }
@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException { throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req; HttpServletRequest request = (HttpServletRequest) req;
@ -133,9 +134,11 @@ public class WebRequestTraceFilter implements Filter, Ordered {
return trace; return trace;
} }
@Override
public void init(FilterConfig filterConfig) throws ServletException { public void init(FilterConfig filterConfig) throws ServletException {
} }
@Override
public void destroy() { public void destroy() {
} }

@ -16,7 +16,6 @@
package org.springframework.bootstrap.actuate.fixme; package org.springframework.bootstrap.actuate.fixme;
/** /**
* @author Dave Syer * @author Dave Syer
*/ */

@ -63,6 +63,7 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner,
this.publisher = publisher; this.publisher = publisher;
} }
@Override
public void run(String... args) throws JobExecutionException { public void run(String... args) throws JobExecutionException {
logger.info("Running default command line with: " + Arrays.asList(args)); logger.info("Running default command line with: " + Arrays.asList(args));
launchJobFromProperties(StringUtils.splitArrayElementsIntoProperties(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. * 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 (AnnotationNode annotationNode : node.getAnnotations()) {
for (String annotation : annotations) { for (String annotation : annotations) {

@ -98,6 +98,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
* @param contextPath the contextPath to set * @param contextPath the contextPath to set
* @see #getContextPath * @see #getContextPath
*/ */
@Override
public void setContextPath(String contextPath) { public void setContextPath(String contextPath) {
Assert.notNull(contextPath, "ContextPath must not be null"); Assert.notNull(contextPath, "ContextPath must not be null");
if (contextPath.length() > 0) { 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 * 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. * with "/" and not end with "/". The root context is represented by an empty string.
*/ */
@Override
public String getContextPath() { public String getContextPath() {
return this.contextPath; return this.contextPath;
} }
@ -127,6 +129,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
* *
* @param port the port to set * @param port the port to set
*/ */
@Override
public void setPort(int port) { public void setPort(int port) {
if (port < 0 || port > 65535) { if (port < 0 || port > 65535) {
throw new IllegalArgumentException("Port must be between 1 and 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. * Returns the port that the embedded servlet container should listen on.
*/ */
@Override
public int getPort() { public int getPort() {
return this.port; return this.port;
} }
@ -146,6 +150,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
* *
* @param address the address to set (defaults to null) * @param address the address to set (defaults to null)
*/ */
@Override
public void setAddress(InetAddress address) { public void setAddress(InetAddress address) {
this.address = address; this.address = address;
} }
@ -153,18 +158,20 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
/** /**
* @return the address the embedded container binds to * @return the address the embedded container binds to
*/ */
@Override
public InetAddress getAddress() { public InetAddress getAddress() {
return this.address; return this.address;
} }
/** /**
* Sets {@link ServletContextInitializer} that should be applied in addition to * Sets {@link ServletContextInitializer} that should be applied in addition to
* {@link #getEmbeddedServletContainer(ServletContextInitializer...)} parameters. * {@link #getEmbeddedServletContainer(ServletContextInitializer...)} parameters. This
* This method will replace any previously set or added initializers. * method will replace any previously set or added initializers.
* @param initializers the initializers to set * @param initializers the initializers to set
* @see #addInitializers * @see #addInitializers
* @see #getInitializers * @see #getInitializers
*/ */
@Override
public void setInitializers(List<? extends ServletContextInitializer> initializers) { public void setInitializers(List<? extends ServletContextInitializer> initializers) {
Assert.notNull(initializers, "Initializers must not be null"); Assert.notNull(initializers, "Initializers must not be null");
this.initializers = new ArrayList<ServletContextInitializer>(initializers); this.initializers = new ArrayList<ServletContextInitializer>(initializers);

@ -35,6 +35,7 @@ public abstract class SpringServletInitializer implements WebApplicationInitiali
/** Logger available to subclasses. */ /** Logger available to subclasses. */
protected final Log logger = LogFactory.getLog(getClass()); protected final Log logger = LogFactory.getLog(getClass());
@Override
public void onStartup(ServletContext servletContext) throws ServletException { public void onStartup(ServletContext servletContext) throws ServletException {
WebApplicationContext rootAppContext = this WebApplicationContext rootAppContext = this
.createRootApplicationContext(servletContext); .createRootApplicationContext(servletContext);

@ -13,7 +13,8 @@ public class ProducerApplication implements CommandLineRunner {
@Override @Override
public void run(String... args) throws Exception { public void run(String... args) throws Exception {
new File("target/input").mkdirs(); 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) { for (String arg : args) {
stream.write(arg.getBytes()); stream.write(arg.getBytes());
} }

@ -38,8 +38,8 @@ public class NonAutoConfigurationBootstrapApplicationTests {
private static ConfigurableApplicationContext context; private static ConfigurableApplicationContext context;
@Configuration @Configuration
@Import({ EmbeddedServletContainerAutoConfiguration.class, WebMvcAutoConfiguration.class, @Import({ EmbeddedServletContainerAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class }) WebMvcAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class })
@ComponentScan(basePackageClasses = { SampleController.class, HelloWorldService.class }) @ComponentScan(basePackageClasses = { SampleController.class, HelloWorldService.class })
public static class NonAutoConfigurationBootstrapApplication { public static class NonAutoConfigurationBootstrapApplication {

Loading…
Cancel
Save