Author: markt Date: Fri Oct 9 13:21:53 2015 New Revision: 1707720 URL: http://svn.apache.org/viewvc?rev=1707720&view=rev Log: Javadoc improvements. Use inherited Javadoc since it generally has more information. Fill in gaps using implementation Javadoc where available.
Modified: tomcat/trunk/java/javax/servlet/ServletContext.java tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java Modified: tomcat/trunk/java/javax/servlet/ServletContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletContext.java?rev=1707720&r1=1707719&r2=1707720&view=diff ============================================================================== --- tomcat/trunk/java/javax/servlet/ServletContext.java (original) +++ tomcat/trunk/java/javax/servlet/ServletContext.java Fri Oct 9 13:21:53 2015 @@ -668,10 +668,13 @@ public interface ServletContext { public Map<String, ? extends ServletRegistration> getServletRegistrations(); /** - * TODO SERVLET3 - Add comments - * @param filterName TODO - * @param className TODO - * @return TODO + /** + * Add filter to context. + * @param filterName Name of filter to add + * @param className Name of filter class + * @return <code>null</code> if the filter has already been fully defined, + * else a {@link javax.servlet.FilterRegistration.Dynamic} object + * that can be used to further configure the filter * @throws UnsupportedOperationException If called from a * {@link ServletContextListener#contextInitialized(ServletContextEvent)} * method of a {@link ServletContextListener} that was not defined in a @@ -683,14 +686,15 @@ public interface ServletContext { * If the context has already been initialised * @since Servlet 3.0 */ - public FilterRegistration.Dynamic addFilter(String filterName, - String className); + public FilterRegistration.Dynamic addFilter(String filterName, String className); /** - * TODO SERVLET3 - Add comments - * @param filterName TODO - * @param filter TODO - * @return TODO + * Add filter to context. + * @param filterName Name of filter to add + * @param filter Filter to add + * @return <code>null</code> if the filter has already been fully defined, + * else a {@link javax.servlet.FilterRegistration.Dynamic} object + * that can be used to further configure the filter * @throws UnsupportedOperationException If called from a * {@link ServletContextListener#contextInitialized(ServletContextEvent)} * method of a {@link ServletContextListener} that was not defined in a @@ -705,10 +709,12 @@ public interface ServletContext { public FilterRegistration.Dynamic addFilter(String filterName, Filter filter); /** - * TODO SERVLET3 - Add comments - * @param filterName TODO - * @param filterClass TODO - * @return TODO + * Add filter to context. + * @param filterName Name of filter to add + * @param filterClass Class of filter to add + * @return <code>null</code> if the filter has already been fully defined, + * else a {@link javax.servlet.FilterRegistration.Dynamic} object + * that can be used to further configure the filter * @throws UnsupportedOperationException If called from a * {@link ServletContextListener#contextInitialized(ServletContextEvent)} * method of a {@link ServletContextListener} that was not defined in a @@ -738,8 +744,7 @@ public interface ServletContext { * @throws ServletException TODO * @since Servlet 3. */ - public <T extends Filter> T createFilter(Class<T> c) - throws ServletException; + public <T extends Filter> T createFilter(Class<T> c) throws ServletException; /** * TODO SERVLET3 - Add comments Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=1707720&r1=1707719&r2=1707720&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java Fri Oct 9 13:21:53 2015 @@ -715,71 +715,25 @@ public class ApplicationContext } - /** - * Add filter to context. - * @param filterName Name of filter to add - * @param filterClass Name of filter class - * @return <code>null</code> if the filter has already been fully defined, - * else a {@link javax.servlet.FilterRegistration.Dynamic} object - * that can be used to further configure the filter - * @throws IllegalStateException if the context has already been initialised - * @throws UnsupportedOperationException - if this context was passed to the - * {@link ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)} - * method of a {@link ServletContextListener} that was not declared - * in web.xml, a web-fragment or annotated with - * {@link javax.servlet.annotation.WebListener}. - */ @Override - public FilterRegistration.Dynamic addFilter(String filterName, - String filterClass) throws IllegalStateException { - - return addFilter(filterName, filterClass, null); + public FilterRegistration.Dynamic addFilter(String filterName, String className) { + return addFilter(filterName, className, null); } - /** - * Add filter to context. - * @param filterName Name of filter to add - * @param filter Filter to add - * @return <code>null</code> if the filter has already been fully defined, - * else a {@link javax.servlet.FilterRegistration.Dynamic} object - * that can be used to further configure the filter - * @throws IllegalStateException if the context has already been initialised - * @throws UnsupportedOperationException - if this context was passed to the - * {@link ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)} - * method of a {@link ServletContextListener} that was not declared - * in web.xml, a web-fragment or annotated with - * {@link javax.servlet.annotation.WebListener}. - */ @Override - public FilterRegistration.Dynamic addFilter(String filterName, - Filter filter) throws IllegalStateException { - + public FilterRegistration.Dynamic addFilter(String filterName, Filter filter) { return addFilter(filterName, null, filter); } - /** - * Add filter to context. - * @param filterName Name of filter to add - * @param filterClass Class of filter to add - * @return <code>null</code> if the filter has already been fully defined, - * else a {@link javax.servlet.FilterRegistration.Dynamic} object - * that can be used to further configure the filter - * @throws IllegalStateException if the context has already been initialised - * @throws UnsupportedOperationException - if this context was passed to the - * {@link ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)} - * method of a {@link ServletContextListener} that was not declared - * in web.xml, a web-fragment or annotated with - * {@link javax.servlet.annotation.WebListener}. - */ @Override public FilterRegistration.Dynamic addFilter(String filterName, - Class<? extends Filter> filterClass) throws IllegalStateException { - + Class<? extends Filter> filterClass) { return addFilter(filterName, filterClass.getName(), null); } + private FilterRegistration.Dynamic addFilter(String filterName, String filterClass, Filter filter) throws IllegalStateException { @@ -820,9 +774,9 @@ public class ApplicationContext return new ApplicationFilterRegistration(filterDef, context); } + @Override - public <T extends Filter> T createFilter(Class<T> c) - throws ServletException { + public <T extends Filter> T createFilter(Class<T> c) throws ServletException { try { @SuppressWarnings("unchecked") T filter = (T) context.getInstanceManager().newInstance(c.getName()); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org