From cc2e7bb3d75f989859316cff8f0f53ab502d8929 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 5 Aug 2013 19:13:16 +0200 Subject: [PATCH] Polish AbstractContextLoaderInitializer and subclasses This commit polishes the Javadoc and assertion failure messages for AbstractContextLoaderInitializer and its subclasses. --- .../AbstractContextLoaderInitializer.java | 4 ++-- ...ionConfigDispatcherServletInitializer.java | 6 ++--- .../AbstractDispatcherServletInitializer.java | 22 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/context/AbstractContextLoaderInitializer.java b/spring-web/src/main/java/org/springframework/web/context/AbstractContextLoaderInitializer.java index 486da7952a..636aceacfb 100644 --- a/spring-web/src/main/java/org/springframework/web/context/AbstractContextLoaderInitializer.java +++ b/spring-web/src/main/java/org/springframework/web/context/AbstractContextLoaderInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,7 @@ public abstract class AbstractContextLoaderInitializer implements WebApplication } /** - * Create the "root" application context to be provided to the + * Create the "root" application context to be provided to the * {@code ContextLoaderListener}. *

The returned context is delegated to * {@link ContextLoaderListener#ContextLoaderListener(WebApplicationContext)} and will diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/AbstractAnnotationConfigDispatcherServletInitializer.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/AbstractAnnotationConfigDispatcherServletInitializer.java index 70bdd82689..5de7a62f05 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/AbstractAnnotationConfigDispatcherServletInitializer.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/AbstractAnnotationConfigDispatcherServletInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import org.springframework.web.context.support.AnnotationConfigWebApplicationCon * configured with annotated classes, e.g. Spring's {@link * org.springframework.context.annotation.Configuration @Configuration} classes. * - *

Concrete implementations are required to implement {@link #getRootConfigClasses()}, - * {@link #getServletConfigClasses()}, as well as {@link #getServletMappings()}. Further + *

Concrete implementations are required to implement {@link #getRootConfigClasses()} + * and {@link #getServletConfigClasses()} as well as {@link #getServletMappings()}. Further * template and customization methods are provided by {@link * AbstractDispatcherServletInitializer}. * diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/AbstractDispatcherServletInitializer.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/AbstractDispatcherServletInitializer.java index d6e6d01053..e2c58d3fa2 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/AbstractDispatcherServletInitializer.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/AbstractDispatcherServletInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ import org.springframework.web.servlet.DispatcherServlet; * *

Concrete implementations are required to implement {@link * #createServletApplicationContext()}, as well as {@link #getServletMappings()}, both of - * which gets invoked from {@link #registerDispatcherServlet(ServletContext)}. Further + * which get invoked from {@link #registerDispatcherServlet(ServletContext)}. Further * customization can be achieved by overriding * {@link #customizeRegistration(ServletRegistration.Dynamic)}. * @@ -72,7 +72,7 @@ public abstract class AbstractDispatcherServletInitializer /** * Register a {@link DispatcherServlet} against the given servlet context. - *

This method will create a {@code DispatcherServlet} with the name returned by + *

This method will create a {@code DispatcherServlet} with the name returned from * {@link #getServletName()}, initializing it with the application context returned * from {@link #createServletApplicationContext()}, and mapping it to the patterns * returned from {@link #getServletMappings()}. @@ -82,8 +82,7 @@ public abstract class AbstractDispatcherServletInitializer */ protected void registerDispatcherServlet(ServletContext servletContext) { String servletName = this.getServletName(); - Assert.hasLength(servletName, - "getServletName() may not return empty or null"); + Assert.hasLength(servletName, "getServletName() may not return empty or null"); WebApplicationContext servletAppContext = this.createServletApplicationContext(); Assert.notNull(servletAppContext, @@ -96,7 +95,7 @@ public abstract class AbstractDispatcherServletInitializer servletContext.addServlet(servletName, dispatcherServlet); Assert.notNull(registration, - "Failed to register servlet with name '" + servletName + "'." + + "Failed to register servlet with name '" + servletName + "'. " + "Check if there is another servlet registered under the same name."); registration.setLoadOnStartup(1); @@ -125,7 +124,7 @@ public abstract class AbstractDispatcherServletInitializer /** * Create a servlet application context to be provided to the {@code DispatcherServlet}. *

The returned context is delegated to Spring's - * {@link DispatcherServlet#DispatcherServlet(WebApplicationContext)} As such, it + * {@link DispatcherServlet#DispatcherServlet(WebApplicationContext)}. As such, it * typically contains controllers, view resolvers, locale resolvers, and other * web-related beans. * @see #registerDispatcherServlet(ServletContext) @@ -133,13 +132,14 @@ public abstract class AbstractDispatcherServletInitializer protected abstract WebApplicationContext createServletApplicationContext(); /** - * Specify the servlet mapping(s) for the {@code DispatcherServlet}, e.g. '/', '/app', etc. + * Specify the servlet mapping(s) for the {@code DispatcherServlet} — + * for example {@code "/"}, {@code "/app"}, etc. * @see #registerDispatcherServlet(ServletContext) */ protected abstract String[] getServletMappings(); /** - * Specify filters to add and also map to the {@code DispatcherServlet}. + * Specify filters to add and map to the {@code DispatcherServlet}. * * @return an array of filters or {@code null} * @see #registerServletFilter(ServletContext, Filter) @@ -159,8 +159,8 @@ public abstract class AbstractDispatcherServletInitializer * {@code FORWARD}, {@code INCLUDE}, and conditionally {@code ASYNC} depending * on the return value of {@link #isAsyncSupported() asyncSupported} * - *

If the above defaults are not suitable or insufficient, register - * filters directly with the {@code ServletContext}. + *

If the above defaults are not suitable or insufficient, override this + * method and register filters directly with the {@code ServletContext}. * * @param servletContext the servlet context to register filters with * @param filter the filter to be registered