From 9e3954f53391dd4c2769eb7b61bf8288e4c85035 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 24 Oct 2010 13:33:33 +0000 Subject: [PATCH] Allow Checkstyle's unused imports test to be used with the o.a.catalina.core package (partial) Fix some Eclipse warnings git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1026797 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/catalina/core/ApplicationContext.java | 67 ++++++++++++++++++---- .../catalina/core/ApplicationContextFacade.java | 41 +++++++++++++ .../catalina/core/ApplicationDispatcher.java | 8 +-- .../catalina/core/ApplicationFilterChain.java | 4 ++ .../catalina/core/ApplicationFilterConfig.java | 4 ++ .../catalina/core/ApplicationHttpRequest.java | 2 + 6 files changed, 112 insertions(+), 14 deletions(-) diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java index a590c5318..12994b2b1 100644 --- a/java/org/apache/catalina/core/ApplicationContext.java +++ b/java/org/apache/catalina/core/ApplicationContext.java @@ -52,7 +52,6 @@ import javax.servlet.ServletRequestAttributeListener; import javax.servlet.ServletRequestListener; import javax.servlet.SessionCookieConfig; import javax.servlet.SessionTrackingMode; -import javax.servlet.annotation.WebListener; import javax.servlet.descriptor.JspConfigDescriptor; import javax.servlet.http.HttpSessionAttributeListener; import javax.servlet.http.HttpSessionListener; @@ -234,6 +233,7 @@ public class ApplicationContext * * @param name Name of the context attribute to return */ + @Override public Object getAttribute(String name) { return (attributes.get(name)); @@ -245,6 +245,7 @@ public class ApplicationContext * Return an enumeration of the names of the context attributes * associated with this context. */ + @Override public Enumeration getAttributeNames() { return new Enumerator(attributes.keySet(), true); @@ -262,6 +263,7 @@ public class ApplicationContext * * @param uri Absolute URI of a resource on the server */ + @Override public ServletContext getContext(String uri) { // Validate the format of the specified argument @@ -305,6 +307,7 @@ public class ApplicationContext /** * Return the main path associated with this context. */ + @Override public String getContextPath() { return context.getPath(); } @@ -316,6 +319,7 @@ public class ApplicationContext * * @param name Name of the initialization parameter to retrieve */ + @Override public String getInitParameter(final String name) { return parameters.get(name); } @@ -325,6 +329,7 @@ public class ApplicationContext * Return the names of the context's initialization parameters, or an * empty enumeration if the context has no initialization parameters. */ + @Override public Enumeration getInitParameterNames() { return (new Enumerator(parameters.keySet())); } @@ -333,6 +338,7 @@ public class ApplicationContext /** * Return the major version of the Java Servlet API that we implement. */ + @Override public int getMajorVersion() { return (Constants.MAJOR_VERSION); @@ -343,6 +349,7 @@ public class ApplicationContext /** * Return the minor version of the Java Servlet API that we implement. */ + @Override public int getMinorVersion() { return (Constants.MINOR_VERSION); @@ -356,6 +363,7 @@ public class ApplicationContext * * @param file Filename for which to identify a MIME type */ + @Override public String getMimeType(String file) { if (file == null) @@ -377,6 +385,7 @@ public class ApplicationContext * * @param name Name of the servlet for which a dispatcher is requested */ + @Override public RequestDispatcher getNamedDispatcher(String name) { // Validate the name argument @@ -399,6 +408,7 @@ public class ApplicationContext * * @param path The path to the desired resource */ + @Override public String getRealPath(String path) { return context.getRealPath(path); } @@ -411,6 +421,7 @@ public class ApplicationContext * * @param path The path to the desired resource. */ + @Override public RequestDispatcher getRequestDispatcher(String path) { // Validate the path argument @@ -505,6 +516,7 @@ public class ApplicationContext * @exception MalformedURLException if the path is not given * in the correct form */ + @Override public URL getResource(String path) throws MalformedURLException { @@ -550,6 +562,7 @@ public class ApplicationContext * * @param path The path to the desired resource. */ + @Override public InputStream getResourceAsStream(String path) { if (path == null) @@ -588,6 +601,7 @@ public class ApplicationContext * * @param path Collection path */ + @Override public Set getResourcePaths(String path) { // Validate the path argument @@ -636,6 +650,7 @@ public class ApplicationContext /** * Return the name and version of the servlet container. */ + @Override public String getServerInfo() { return (ServerInfo.getServerInfo()); @@ -646,6 +661,7 @@ public class ApplicationContext /** * @deprecated As of Java Servlet API 2.1, with no direct replacement. */ + @Override @Deprecated public Servlet getServlet(String name) { @@ -657,6 +673,7 @@ public class ApplicationContext /** * Return the display name of this web application. */ + @Override public String getServletContextName() { return (context.getDisplayName()); @@ -667,6 +684,7 @@ public class ApplicationContext /** * @deprecated As of Java Servlet API 2.1, with no direct replacement. */ + @Override @Deprecated public Enumeration getServletNames() { return (new Enumerator(emptyString)); @@ -676,6 +694,7 @@ public class ApplicationContext /** * @deprecated As of Java Servlet API 2.1, with no direct replacement. */ + @Override @Deprecated public Enumeration getServlets() { return (new Enumerator(emptyServlet)); @@ -687,6 +706,7 @@ public class ApplicationContext * * @param message Message to be written */ + @Override public void log(String message) { context.getLogger().info(message); @@ -703,6 +723,7 @@ public class ApplicationContext * @deprecated As of Java Servlet API 2.1, use * log(String, Throwable) instead */ + @Override @Deprecated public void log(Exception exception, String message) { @@ -717,6 +738,7 @@ public class ApplicationContext * @param message Message to be written * @param throwable Exception to be reported */ + @Override public void log(String message, Throwable throwable) { context.getLogger().error(message, throwable); @@ -729,6 +751,7 @@ public class ApplicationContext * * @param name Name of the context attribute to be removed */ + @Override public void removeAttribute(String name) { Object value = null; @@ -783,6 +806,7 @@ public class ApplicationContext * @param name Attribute name to be bound * @param value New attribute value to be bound */ + @Override public void setAttribute(String name, Object value) { // Name cannot be null @@ -868,8 +892,10 @@ public class ApplicationContext * @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 WebListener}. + * 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 { @@ -888,8 +914,10 @@ public class ApplicationContext * @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 WebListener}. + * 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 { @@ -908,8 +936,10 @@ public class ApplicationContext * @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 WebListener}. + * in web.xml, a web-fragment or annotated with + * {@link javax.servlet.annotation.WebListener}. */ + @Override public FilterRegistration.Dynamic addFilter(String filterName, Class filterClass) throws IllegalStateException { @@ -930,7 +960,8 @@ public class ApplicationContext // throw 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 WebListener}. + // in web.xml, a web-fragment or annotated with + // {@link javax.servlet.annotation.WebListener}. FilterDef filterDef = context.findFilterDef(filterName); @@ -957,6 +988,7 @@ public class ApplicationContext return new ApplicationFilterRegistration(filterDef, context); } + @Override public T createFilter(Class c) throws ServletException { try { @@ -977,6 +1009,7 @@ public class ApplicationContext } + @Override public FilterRegistration getFilterRegistration(String filterName) { FilterDef filterDef = context.findFilterDef(filterName); if (filterDef == null) { @@ -997,8 +1030,10 @@ public class ApplicationContext * @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 WebListener}. + * in web.xml, a web-fragment or annotated with + * {@link javax.servlet.annotation.WebListener}. */ + @Override public ServletRegistration.Dynamic addServlet(String servletName, String servletClass) throws IllegalStateException { @@ -1017,8 +1052,10 @@ public class ApplicationContext * @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 WebListener}. + * in web.xml, a web-fragment or annotated with + * {@link javax.servlet.annotation.WebListener}. */ + @Override public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) throws IllegalStateException { @@ -1037,8 +1074,10 @@ public class ApplicationContext * @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 WebListener}. + * in web.xml, a web-fragment or annotated with + * {@link javax.servlet.annotation.WebListener}. */ + @Override public ServletRegistration.Dynamic addServlet(String servletName, Class servletClass) throws IllegalStateException { @@ -1060,7 +1099,8 @@ public class ApplicationContext // throw 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 WebListener}. + // in web.xml, a web-fragment or annotated with + // {@link javax.servlet.annotation.WebListener}. Wrapper wrapper = (Wrapper) context.findChild(servletName); @@ -1088,6 +1128,7 @@ public class ApplicationContext } + @Override public T createServlet(Class c) throws ServletException { try { @@ -1109,6 +1150,7 @@ public class ApplicationContext } + @Override public ServletRegistration getServletRegistration(String servletName) { Wrapper wrapper = (Wrapper) context.findChild(servletName); if (wrapper == null) { @@ -1127,6 +1169,7 @@ public class ApplicationContext * used by this context has the attribute secure set to * true. */ + @Override public Set getDefaultSessionTrackingModes() { return defaultSessionTrackingModes; } @@ -1158,6 +1201,7 @@ public class ApplicationContext * Return the supplied value if one was previously set, else return the * defaults. */ + @Override public Set getEffectiveSessionTrackingModes() { if (sessionTrackingModes != null) { return sessionTrackingModes; @@ -1166,6 +1210,7 @@ public class ApplicationContext } + @Override public SessionCookieConfig getSessionCookieConfig() { return sessionCookieConfig; } @@ -1177,6 +1222,7 @@ public class ApplicationContext * anything else or if an unsupported * tracking mode is requested */ + @Override public void setSessionTrackingModes( Set sessionTrackingModes) { @@ -1284,7 +1330,8 @@ public class ApplicationContext // throw 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 WebListener}. + // in web.xml, a web-fragment or annotated with + // {@link javax.servlet.annotation.WebListener}. boolean match = false; if (t instanceof ServletContextAttributeListener || diff --git a/java/org/apache/catalina/core/ApplicationContextFacade.java b/java/org/apache/catalina/core/ApplicationContextFacade.java index 1a85cbb0d..b9aadf453 100644 --- a/java/org/apache/catalina/core/ApplicationContextFacade.java +++ b/java/org/apache/catalina/core/ApplicationContextFacade.java @@ -135,6 +135,7 @@ public final class ApplicationContextFacade // ------------------------------------------------- ServletContext Methods + @Override public ServletContext getContext(String uripath) { ServletContext theContext = null; if (SecurityUtil.isPackageProtectionEnabled()) { @@ -151,16 +152,19 @@ public final class ApplicationContextFacade } + @Override public int getMajorVersion() { return context.getMajorVersion(); } + @Override public int getMinorVersion() { return context.getMinorVersion(); } + @Override public String getMimeType(String file) { if (SecurityUtil.isPackageProtectionEnabled()) { return (String)doPrivileged("getMimeType", new Object[]{file}); @@ -169,6 +173,7 @@ public final class ApplicationContextFacade } } + @Override @SuppressWarnings("unchecked") // doPrivileged() returns the correct type public Set getResourcePaths(String path) { if (SecurityUtil.isPackageProtectionEnabled()){ @@ -180,6 +185,7 @@ public final class ApplicationContextFacade } + @Override public URL getResource(String path) throws MalformedURLException { if (Globals.IS_SECURITY_ENABLED) { @@ -198,6 +204,7 @@ public final class ApplicationContextFacade } + @Override public InputStream getResourceAsStream(String path) { if (SecurityUtil.isPackageProtectionEnabled()) { return (InputStream) doPrivileged("getResourceAsStream", @@ -208,6 +215,7 @@ public final class ApplicationContextFacade } + @Override public RequestDispatcher getRequestDispatcher(final String path) { if (SecurityUtil.isPackageProtectionEnabled()) { return (RequestDispatcher) doPrivileged("getRequestDispatcher", @@ -218,6 +226,7 @@ public final class ApplicationContextFacade } + @Override public RequestDispatcher getNamedDispatcher(String name) { if (SecurityUtil.isPackageProtectionEnabled()) { return (RequestDispatcher) doPrivileged("getNamedDispatcher", @@ -231,6 +240,7 @@ public final class ApplicationContextFacade /** * @deprecated */ + @Override @Deprecated public Servlet getServlet(String name) throws ServletException { @@ -254,6 +264,7 @@ public final class ApplicationContextFacade /** * @deprecated */ + @Override @SuppressWarnings("unchecked") // doPrivileged() returns the correct type @Deprecated public Enumeration getServlets() { @@ -268,6 +279,7 @@ public final class ApplicationContextFacade /** * @deprecated */ + @Override @SuppressWarnings("unchecked") // doPrivileged() returns the correct type @Deprecated public Enumeration getServletNames() { @@ -279,6 +291,7 @@ public final class ApplicationContextFacade } + @Override public void log(String msg) { if (SecurityUtil.isPackageProtectionEnabled()) { doPrivileged("log", new Object[]{msg} ); @@ -291,6 +304,7 @@ public final class ApplicationContextFacade /** * @deprecated */ + @Override @Deprecated public void log(Exception exception, String msg) { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -302,6 +316,7 @@ public final class ApplicationContextFacade } + @Override public void log(String message, Throwable throwable) { if (SecurityUtil.isPackageProtectionEnabled()) { doPrivileged("log", new Class[]{String.class, Throwable.class}, @@ -312,6 +327,7 @@ public final class ApplicationContextFacade } + @Override public String getRealPath(String path) { if (SecurityUtil.isPackageProtectionEnabled()) { return (String) doPrivileged("getRealPath", new Object[]{path}); @@ -321,6 +337,7 @@ public final class ApplicationContextFacade } + @Override public String getServerInfo() { if (SecurityUtil.isPackageProtectionEnabled()) { return (String) doPrivileged("getServerInfo", null); @@ -330,6 +347,7 @@ public final class ApplicationContextFacade } + @Override public String getInitParameter(String name) { if (SecurityUtil.isPackageProtectionEnabled()) { return (String) doPrivileged("getInitParameter", @@ -340,6 +358,7 @@ public final class ApplicationContextFacade } + @Override @SuppressWarnings("unchecked") // doPrivileged() returns the correct type public Enumeration getInitParameterNames() { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -351,6 +370,7 @@ public final class ApplicationContextFacade } + @Override public Object getAttribute(String name) { if (SecurityUtil.isPackageProtectionEnabled()) { return doPrivileged("getAttribute", new Object[]{name}); @@ -360,6 +380,7 @@ public final class ApplicationContextFacade } + @Override @SuppressWarnings("unchecked") // doPrivileged() returns the correct type public Enumeration getAttributeNames() { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -371,6 +392,7 @@ public final class ApplicationContextFacade } + @Override public void setAttribute(String name, Object object) { if (SecurityUtil.isPackageProtectionEnabled()) { doPrivileged("setAttribute", new Object[]{name,object}); @@ -380,6 +402,7 @@ public final class ApplicationContextFacade } + @Override public void removeAttribute(String name) { if (SecurityUtil.isPackageProtectionEnabled()) { doPrivileged("removeAttribute", new Object[]{name}); @@ -389,6 +412,7 @@ public final class ApplicationContextFacade } + @Override public String getServletContextName() { if (SecurityUtil.isPackageProtectionEnabled()) { return (String) doPrivileged("getServletContextName", null); @@ -398,6 +422,7 @@ public final class ApplicationContextFacade } + @Override public String getContextPath() { if (SecurityUtil.isPackageProtectionEnabled()) { return (String) doPrivileged("getContextPath", null); @@ -407,6 +432,7 @@ public final class ApplicationContextFacade } + @Override public FilterRegistration.Dynamic addFilter(String filterName, String className) { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -418,6 +444,7 @@ public final class ApplicationContextFacade } + @Override public FilterRegistration.Dynamic addFilter(String filterName, Filter filter) { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -429,6 +456,7 @@ public final class ApplicationContextFacade } + @Override public FilterRegistration.Dynamic addFilter(String filterName, Class filterClass) { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -439,6 +467,7 @@ public final class ApplicationContextFacade } } + @Override @SuppressWarnings("unchecked") // doPrivileged() returns the correct type public T createFilter(Class c) throws ServletException { @@ -459,6 +488,7 @@ public final class ApplicationContextFacade } + @Override public FilterRegistration getFilterRegistration(String filterName) { if (SecurityUtil.isPackageProtectionEnabled()) { return (FilterRegistration) doPrivileged( @@ -469,6 +499,7 @@ public final class ApplicationContextFacade } + @Override public ServletRegistration.Dynamic addServlet(String servletName, String className) { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -480,6 +511,7 @@ public final class ApplicationContextFacade } + @Override public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -491,6 +523,7 @@ public final class ApplicationContextFacade } + @Override public ServletRegistration.Dynamic addServlet(String servletName, Class servletClass) { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -502,6 +535,7 @@ public final class ApplicationContextFacade } + @Override @SuppressWarnings("unchecked") // doPrivileged() returns the correct type public T createServlet(Class c) throws ServletException { @@ -522,6 +556,7 @@ public final class ApplicationContextFacade } + @Override public ServletRegistration getServletRegistration(String servletName) { if (SecurityUtil.isPackageProtectionEnabled()) { return (ServletRegistration) doPrivileged( @@ -532,6 +567,7 @@ public final class ApplicationContextFacade } + @Override @SuppressWarnings("unchecked") // doPrivileged() returns the correct type public Set getDefaultSessionTrackingModes() { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -542,6 +578,7 @@ public final class ApplicationContextFacade } } + @Override @SuppressWarnings("unchecked") // doPrivileged() returns the correct type public Set getEffectiveSessionTrackingModes() { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -553,6 +590,7 @@ public final class ApplicationContextFacade } + @Override public SessionCookieConfig getSessionCookieConfig() { if (SecurityUtil.isPackageProtectionEnabled()) { return (SessionCookieConfig) @@ -563,6 +601,7 @@ public final class ApplicationContextFacade } + @Override public void setSessionTrackingModes( Set sessionTrackingModes) { if (SecurityUtil.isPackageProtectionEnabled()) { @@ -574,6 +613,7 @@ public final class ApplicationContextFacade } + @Override public boolean setInitParameter(String name, String value) { if (SecurityUtil.isPackageProtectionEnabled()) { return ((Boolean) doPrivileged("setInitParameter", @@ -805,6 +845,7 @@ public final class ApplicationContextFacade if (SecurityUtil.isPackageProtectionEnabled()){ return AccessController.doPrivileged(new PrivilegedExceptionAction(){ + @Override public Object run() throws IllegalAccessException, InvocationTargetException{ return method.invoke(context, params); } diff --git a/java/org/apache/catalina/core/ApplicationDispatcher.java b/java/org/apache/catalina/core/ApplicationDispatcher.java index c4b896c1c..55c071343 100644 --- a/java/org/apache/catalina/core/ApplicationDispatcher.java +++ b/java/org/apache/catalina/core/ApplicationDispatcher.java @@ -47,8 +47,6 @@ import org.apache.catalina.connector.RequestFacade; import org.apache.catalina.connector.Response; import org.apache.catalina.connector.ResponseFacade; import org.apache.catalina.util.InstanceSupport; -import org.apache.juli.logging.Log; -import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.ExceptionUtils; import org.apache.tomcat.util.res.StringManager; @@ -69,8 +67,6 @@ import org.apache.tomcat.util.res.StringManager; final class ApplicationDispatcher implements RequestDispatcher { - private static final Log log = LogFactory.getLog(ApplicationDispatcher.class); - protected static final boolean STRICT_SERVLET_COMPLIANCE; protected static final boolean WRAP_SAME_OBJECT; @@ -101,6 +97,7 @@ final class ApplicationDispatcher this.response = response; } + @Override public Void run() throws java.lang.Exception { doForward(request,response); return null; @@ -118,6 +115,7 @@ final class ApplicationDispatcher this.response = response; } + @Override public Void run() throws ServletException, IOException { DispatcherType type = DispatcherType.INCLUDE; if (request.getDispatcherType()==DispatcherType.ASYNC) type = DispatcherType.ASYNC; @@ -313,6 +311,7 @@ final class ApplicationDispatcher * @exception IOException if an input/output error occurs * @exception ServletException if a servlet exception occurs */ + @Override public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException { @@ -497,6 +496,7 @@ final class ApplicationDispatcher * @exception IOException if an input/output error occurs * @exception ServletException if a servlet exception occurs */ + @Override public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException { diff --git a/java/org/apache/catalina/core/ApplicationFilterChain.java b/java/org/apache/catalina/core/ApplicationFilterChain.java index 395c2a590..38d14aecd 100644 --- a/java/org/apache/catalina/core/ApplicationFilterChain.java +++ b/java/org/apache/catalina/core/ApplicationFilterChain.java @@ -177,6 +177,7 @@ final class ApplicationFilterChain implements FilterChain, CometFilterChain { * @exception IOException if an input/output error occurs * @exception ServletException if a servlet exception occurs */ + @Override public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException { @@ -186,6 +187,7 @@ final class ApplicationFilterChain implements FilterChain, CometFilterChain { try { java.security.AccessController.doPrivileged( new java.security.PrivilegedExceptionAction() { + @Override public Void run() throws ServletException, IOException { internalDoFilter(req,res); @@ -344,6 +346,7 @@ final class ApplicationFilterChain implements FilterChain, CometFilterChain { * @exception IOException if an input/output error occurs * @exception ServletException if a servlet exception occurs */ + @Override public void doFilterEvent(CometEvent event) throws IOException, ServletException { @@ -352,6 +355,7 @@ final class ApplicationFilterChain implements FilterChain, CometFilterChain { try { java.security.AccessController.doPrivileged( new java.security.PrivilegedExceptionAction() { + @Override public Void run() throws ServletException, IOException { internalDoFilterEvent(ev); diff --git a/java/org/apache/catalina/core/ApplicationFilterConfig.java b/java/org/apache/catalina/core/ApplicationFilterConfig.java index 098474056..b9238cc7b 100644 --- a/java/org/apache/catalina/core/ApplicationFilterConfig.java +++ b/java/org/apache/catalina/core/ApplicationFilterConfig.java @@ -140,6 +140,7 @@ public final class ApplicationFilterConfig implements FilterConfig, Serializable /** * Return the name of the filter we are configuring. */ + @Override public String getFilterName() { return (filterDef.getFilterName()); } @@ -158,6 +159,7 @@ public final class ApplicationFilterConfig implements FilterConfig, Serializable * * @param name Name of the requested initialization parameter */ + @Override public String getInitParameter(String name) { Map map = filterDef.getParameterMap(); @@ -174,6 +176,7 @@ public final class ApplicationFilterConfig implements FilterConfig, Serializable * Return an Enumeration of the names of the initialization * parameters for this Filter. */ + @Override public Enumeration getInitParameterNames() { Map map = filterDef.getParameterMap(); @@ -189,6 +192,7 @@ public final class ApplicationFilterConfig implements FilterConfig, Serializable /** * Return the ServletContext of our associated web application. */ + @Override public ServletContext getServletContext() { return this.context.getServletContext(); diff --git a/java/org/apache/catalina/core/ApplicationHttpRequest.java b/java/org/apache/catalina/core/ApplicationHttpRequest.java index 21501120b..adbec8fbd 100644 --- a/java/org/apache/catalina/core/ApplicationHttpRequest.java +++ b/java/org/apache/catalina/core/ApplicationHttpRequest.java @@ -936,11 +936,13 @@ class ApplicationHttpRequest extends HttpServletRequestWrapper { } } + @Override public boolean hasMoreElements() { return ((pos != last) || (next != null) || ((next = findNext()) != null)); } + @Override public String nextElement() { if (pos != last) { for (int i = pos + 1; i <= last; i++) { -- 2.11.0