From: markt Date: Sun, 24 Oct 2010 14:09:37 +0000 (+0000) Subject: Allow Checkstyle's unused imports test to be used with the o.a.catalina.core package... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6f2ae403eb1c0e532abc383f9eff7a28b08e75d4;p=tomcat7.0 Allow Checkstyle's unused imports test to be used with the o.a.catalina.core package (remainder) Fix some Eclipse warnings git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1026802 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/core/StandardContextValve.java b/java/org/apache/catalina/core/StandardContextValve.java index e3444a0ee..1a29ee014 100644 --- a/java/org/apache/catalina/core/StandardContextValve.java +++ b/java/org/apache/catalina/core/StandardContextValve.java @@ -31,7 +31,6 @@ import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.catalina.valves.ValveBase; import org.apache.tomcat.util.buf.MessageBytes; -import org.apache.tomcat.util.res.StringManager; /** * Valve that implements the default basic behavior for the @@ -62,13 +61,6 @@ final class StandardContextValve "org.apache.catalina.core.StandardContextValve/1.0"; - /** - * The string manager for this package. - */ - private static final StringManager sm = - StringManager.getManager(Constants.Package); - - private StandardContext context = null; diff --git a/java/org/apache/catalina/core/StandardServer.java b/java/org/apache/catalina/core/StandardServer.java index 7a538e65c..28a21d6ec 100644 --- a/java/org/apache/catalina/core/StandardServer.java +++ b/java/org/apache/catalina/core/StandardServer.java @@ -32,7 +32,6 @@ import java.util.Random; import javax.management.ObjectName; import org.apache.catalina.Context; -import org.apache.catalina.Engine; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleState; import org.apache.catalina.Server; @@ -41,7 +40,6 @@ import org.apache.catalina.deploy.NamingResources; import org.apache.catalina.mbeans.MBeanFactory; import org.apache.catalina.mbeans.MBeanUtils; import org.apache.catalina.startup.Catalina; -import org.apache.catalina.util.LifecycleBase; import org.apache.catalina.util.LifecycleMBeanBase; import org.apache.catalina.util.ServerInfo; import org.apache.juli.logging.Log; @@ -190,6 +188,7 @@ public final class StandardServer extends LifecycleMBeanBase /** * Return the global naming resources. */ + @Override public NamingResources getGlobalNamingResources() { return (this.globalNamingResources); @@ -202,6 +201,7 @@ public final class StandardServer extends LifecycleMBeanBase * * @param globalNamingResources The new global naming resources */ + @Override public void setGlobalNamingResources (NamingResources globalNamingResources) { @@ -221,6 +221,7 @@ public final class StandardServer extends LifecycleMBeanBase * the corresponding version number, in the format * <description>/<version>. */ + @Override public String getInfo() { return (info); @@ -239,6 +240,7 @@ public final class StandardServer extends LifecycleMBeanBase /** * Return the port number we listen to for shutdown commands. */ + @Override public int getPort() { return (this.port); @@ -251,6 +253,7 @@ public final class StandardServer extends LifecycleMBeanBase * * @param port The new port number */ + @Override public void setPort(int port) { this.port = port; @@ -261,6 +264,7 @@ public final class StandardServer extends LifecycleMBeanBase /** * Return the address on which we listen to for shutdown commands. */ + @Override public String getAddress() { return (this.address); @@ -273,6 +277,7 @@ public final class StandardServer extends LifecycleMBeanBase * * @param address The new address */ + @Override public void setAddress(String address) { this.address = address; @@ -282,6 +287,7 @@ public final class StandardServer extends LifecycleMBeanBase /** * Return the shutdown command string we are waiting for. */ + @Override public String getShutdown() { return (this.shutdown); @@ -294,6 +300,7 @@ public final class StandardServer extends LifecycleMBeanBase * * @param shutdown The new shutdown command */ + @Override public void setShutdown(String shutdown) { this.shutdown = shutdown; @@ -326,6 +333,7 @@ public final class StandardServer extends LifecycleMBeanBase * * @param service The Service to be added */ + @Override public void addService(Service service) { service.setServer(this); @@ -359,6 +367,7 @@ public final class StandardServer extends LifecycleMBeanBase * This keeps the main thread alive - the thread pool listening for http * connections is daemon threads. */ + @Override public void await() { // Negative values - don't wait on port - tomcat is embedded or we just don't like ports if( port == -2 ) { @@ -463,6 +472,7 @@ public final class StandardServer extends LifecycleMBeanBase * * @param name Name of the Service to be returned */ + @Override public Service findService(String name) { if (name == null) { @@ -483,6 +493,7 @@ public final class StandardServer extends LifecycleMBeanBase /** * Return the set of Services defined within this Server. */ + @Override public Service[] findServices() { return (services); @@ -507,6 +518,7 @@ public final class StandardServer extends LifecycleMBeanBase * * @param service The Service to be removed */ + @Override public void removeService(Service service) { synchronized (services) { @@ -645,7 +657,7 @@ public final class StandardServer extends LifecycleMBeanBase /** * Start nested components ({@link Service}s) and implement the requirements - * of {@link LifecycleBase#startInternal()}. + * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used @@ -667,7 +679,7 @@ public final class StandardServer extends LifecycleMBeanBase /** * Stop nested components ({@link Service}s) and implement the requirements - * of {@link LifecycleBase#stopInternal()}. + * of {@link org.apache.catalina.util.LifecycleBase#stopInternal()}. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported @@ -753,7 +765,7 @@ public final class StandardServer extends LifecycleMBeanBase * Obtain the MBean domain for this server. The domain is obtained using * the following search order: *
    - *
  1. Name of first {@link Engine}.
  2. + *
  3. Name of first {@link org.apache.catalina.Engine}.
  4. *
  5. Name of first {@link Service}.
  6. *
*/ diff --git a/java/org/apache/catalina/core/StandardService.java b/java/org/apache/catalina/core/StandardService.java index e31d83a46..cbada8120 100644 --- a/java/org/apache/catalina/core/StandardService.java +++ b/java/org/apache/catalina/core/StandardService.java @@ -34,7 +34,6 @@ import org.apache.catalina.Server; import org.apache.catalina.Service; import org.apache.catalina.connector.Connector; import org.apache.catalina.mbeans.MBeanUtils; -import org.apache.catalina.util.LifecycleBase; import org.apache.catalina.util.LifecycleMBeanBase; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; @@ -112,6 +111,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * Return the Container that handles requests for all * Connectors associated with this Service. */ + @Override public Container getContainer() { return (this.container); @@ -125,6 +125,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * * @param container The new Container */ + @Override public void setContainer(Container container) { Container oldContainer = this.container; @@ -159,6 +160,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * the corresponding version number, in the format * <description>/<version>. */ + @Override public String getInfo() { return (info); @@ -169,6 +171,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { /** * Return the name of this Service. */ + @Override public String getName() { return (this.name); @@ -181,6 +184,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * * @param name The new service name */ + @Override public void setName(String name) { this.name = name; @@ -191,6 +195,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { /** * Return the Server with which we are associated (if any). */ + @Override public Server getServer() { return (this.server); @@ -203,6 +208,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * * @param server The server that owns this Service */ + @Override public void setServer(Server server) { this.server = server; @@ -219,6 +225,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * * @param connector The Connector to be added */ + @Override public void addConnector(Connector connector) { synchronized (connectors) { @@ -268,6 +275,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { /** * Find and return the set of Connectors associated with this Service. */ + @Override public Connector[] findConnectors() { return (connectors); @@ -282,6 +290,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * * @param connector The Connector to be removed */ + @Override public void removeConnector(Connector connector) { synchronized (connectors) { @@ -349,6 +358,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * Adds a named executor to the service * @param ex Executor */ + @Override public void addExecutor(Executor ex) { synchronized (executors) { if (!executors.contains(ex)) { @@ -367,6 +377,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * Retrieves all executors * @return Executor[] */ + @Override public Executor[] findExecutors() { synchronized (executors) { Executor[] arr = new Executor[executors.size()]; @@ -380,6 +391,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * @param executorName String * @return Executor */ + @Override public Executor getExecutor(String executorName) { synchronized (executors) { for (Executor executor: executors) { @@ -394,6 +406,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * Removes an executor from the service * @param ex Executor */ + @Override public void removeExecutor(Executor ex) { synchronized (executors) { if ( executors.remove(ex) && getState().isAvailable() ) { @@ -411,7 +424,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { /** * Start nested components ({@link Executor}s, {@link Connector}s and * {@link Container}s) and implement the requirements of - * {@link LifecycleBase#startInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used @@ -454,7 +467,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { /** * Stop nested components ({@link Executor}s, {@link Connector}s and * {@link Container}s) and implement the requirements of - * {@link LifecycleBase#stopInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported diff --git a/java/org/apache/catalina/core/StandardThreadExecutor.java b/java/org/apache/catalina/core/StandardThreadExecutor.java index 44e6e0ce1..27e267f87 100644 --- a/java/org/apache/catalina/core/StandardThreadExecutor.java +++ b/java/org/apache/catalina/core/StandardThreadExecutor.java @@ -23,7 +23,6 @@ import java.util.concurrent.TimeUnit; import org.apache.catalina.Executor; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleState; -import org.apache.catalina.util.LifecycleBase; import org.apache.catalina.util.LifecycleMBeanBase; import org.apache.tomcat.util.threads.ResizableExecutor; import org.apache.tomcat.util.threads.TaskQueue; @@ -101,7 +100,7 @@ public class StandardThreadExecutor extends LifecycleMBeanBase /** * Start the component and implement the requirements - * of {@link LifecycleBase#startInternal()}. + * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used @@ -123,7 +122,7 @@ public class StandardThreadExecutor extends LifecycleMBeanBase /** * Stop the component and implement the requirements - * of {@link LifecycleBase#stopInternal()}. + * of {@link org.apache.catalina.util.LifecycleBase#stopInternal()}. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported diff --git a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java index e981872af..e18b67a31 100644 --- a/java/org/apache/catalina/core/StandardWrapper.java +++ b/java/org/apache/catalina/core/StandardWrapper.java @@ -58,7 +58,6 @@ import org.apache.catalina.mbeans.MBeanUtils; import org.apache.catalina.security.SecurityUtil; import org.apache.catalina.util.Enumerator; import org.apache.catalina.util.InstanceSupport; -import org.apache.catalina.util.LifecycleBase; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.InstanceManager; @@ -298,6 +297,7 @@ public class StandardWrapper extends ContainerBase * this servlet will return an SC_SERVICE_UNAVAILABLE error. If it is zero, * the servlet is currently available. */ + @Override public long getAvailable() { return (this.available); @@ -314,6 +314,7 @@ public class StandardWrapper extends ContainerBase * * @param available The new available date/time */ + @Override public void setAvailable(long available) { long oldAvailable = this.available; @@ -366,6 +367,7 @@ public class StandardWrapper extends ContainerBase * Return the load-on-startup order value (negative value means * load on first call). */ + @Override public int getLoadOnStartup() { if (isJspServlet && loadOnStartup < 0) { @@ -387,6 +389,7 @@ public class StandardWrapper extends ContainerBase * * @param value New load-on-startup value */ + @Override public void setLoadOnStartup(int value) { int oldLoadOnStartup = this.loadOnStartup; @@ -472,6 +475,7 @@ public class StandardWrapper extends ContainerBase /** * Return the run-as identity for this servlet. */ + @Override public String getRunAs() { return (this.runAs); @@ -484,6 +488,7 @@ public class StandardWrapper extends ContainerBase * * @param runAs New run-as identity value */ + @Override public void setRunAs(String runAs) { String oldRunAs = this.runAs; @@ -496,6 +501,7 @@ public class StandardWrapper extends ContainerBase /** * Return the fully qualified servlet class name for this servlet. */ + @Override public String getServletClass() { return (this.servletClass); @@ -508,6 +514,7 @@ public class StandardWrapper extends ContainerBase * * @param servletClass Servlet class name */ + @Override public void setServletClass(String servletClass) { String oldServletClass = this.servletClass; @@ -555,6 +562,7 @@ public class StandardWrapper extends ContainerBase /** * Is this servlet currently unavailable? */ + @Override public boolean isUnavailable() { if (!isEnabled()) @@ -580,6 +588,7 @@ public class StandardWrapper extends ContainerBase * @return Array of names of the methods supported by the underlying * servlet */ + @Override public String[] getServletMethods() throws ServletException { Class servletClazz = loadServlet().getClass(); @@ -617,6 +626,7 @@ public class StandardWrapper extends ContainerBase /** * Return the associated servlet instance. */ + @Override public Servlet getServlet() { return instance; } @@ -625,6 +635,7 @@ public class StandardWrapper extends ContainerBase /** * Set the associated servlet instance. */ + @Override public void setServlet(Servlet servlet) { instance = servlet; } @@ -691,6 +702,7 @@ public class StandardWrapper extends ContainerBase * @param name Name of this initialization parameter to add * @param value Value of this initialization parameter to add */ + @Override public void addInitParameter(String name, String value) { synchronized (parameters) { @@ -706,6 +718,7 @@ public class StandardWrapper extends ContainerBase * * @param listener The new listener */ + @Override public void addInstanceListener(InstanceListener listener) { instanceSupport.addInstanceListener(listener); @@ -718,6 +731,7 @@ public class StandardWrapper extends ContainerBase * * @param mapping The new wrapper mapping */ + @Override public void addMapping(String mapping) { synchronized (mappings) { @@ -735,6 +749,7 @@ public class StandardWrapper extends ContainerBase * @param name Role name used within this servlet * @param link Role name used within the web application */ + @Override public void addSecurityReference(String name, String link) { synchronized (references) { @@ -758,6 +773,7 @@ public class StandardWrapper extends ContainerBase * an exception * @exception ServletException if a loading error occurs */ + @Override public Servlet allocate() throws ServletException { // If we are currently unloading this servlet, throw an exception @@ -854,6 +870,7 @@ public class StandardWrapper extends ContainerBase * * @exception ServletException if a deallocation error occurs */ + @Override public void deallocate(Servlet servlet) throws ServletException { // If not SingleThreadModel, no action is required @@ -878,6 +895,7 @@ public class StandardWrapper extends ContainerBase * * @param name Name of the requested initialization parameter */ + @Override public String findInitParameter(String name) { synchronized (parameters) { @@ -891,6 +909,7 @@ public class StandardWrapper extends ContainerBase * Return the names of all defined initialization parameters for this * servlet. */ + @Override public String[] findInitParameters() { synchronized (parameters) { @@ -904,6 +923,7 @@ public class StandardWrapper extends ContainerBase /** * Return the mappings associated with this wrapper. */ + @Override public String[] findMappings() { synchronized (mappings) { @@ -919,6 +939,7 @@ public class StandardWrapper extends ContainerBase * * @param name Security role reference used within this servlet */ + @Override public String findSecurityReference(String name) { synchronized (references) { @@ -932,6 +953,7 @@ public class StandardWrapper extends ContainerBase * Return the set of security role reference names associated with * this servlet, if any; otherwise return a zero-length array. */ + @Override public String[] findSecurityReferences() { synchronized (references) { @@ -967,6 +989,7 @@ public class StandardWrapper extends ContainerBase * an exception * @exception ServletException if some other loading problem occurs */ + @Override public synchronized void load() throws ServletException { instance = loadServlet(); @@ -1140,6 +1163,7 @@ public class StandardWrapper extends ContainerBase * * @param name Name of the initialization parameter to remove */ + @Override public void removeInitParameter(String name) { synchronized (parameters) { @@ -1155,6 +1179,7 @@ public class StandardWrapper extends ContainerBase * * @param listener The listener to remove */ + @Override public void removeInstanceListener(InstanceListener listener) { instanceSupport.removeInstanceListener(listener); @@ -1167,6 +1192,7 @@ public class StandardWrapper extends ContainerBase * * @param mapping The pattern to remove */ + @Override public void removeMapping(String mapping) { synchronized (mappings) { @@ -1182,6 +1208,7 @@ public class StandardWrapper extends ContainerBase * * @param name Security role used within this servlet to be removed */ + @Override public void removeSecurityReference(String name) { synchronized (references) { @@ -1218,6 +1245,7 @@ public class StandardWrapper extends ContainerBase * @param unavailable The exception that occurred, or null * to mark this servlet as permanently unavailable */ + @Override public void unavailable(UnavailableException unavailable) { getServletContext().log(sm.getString("standardWrapper.unavailable", getName())); if (unavailable == null) @@ -1245,6 +1273,7 @@ public class StandardWrapper extends ContainerBase * @exception ServletException if an exception is thrown by the * destroy() method */ + @Override public synchronized void unload() throws ServletException { // Nothing to do if we have never loaded the instance @@ -1376,6 +1405,7 @@ public class StandardWrapper extends ContainerBase * * @param name Name of the initialization parameter to retrieve */ + @Override public String getInitParameter(String name) { return (findInitParameter(name)); @@ -1387,6 +1417,7 @@ public class StandardWrapper extends ContainerBase * Return the set of initialization parameter names defined for this * servlet. If none are defined, an empty Enumeration is returned. */ + @Override public Enumeration getInitParameterNames() { synchronized (parameters) { @@ -1399,6 +1430,7 @@ public class StandardWrapper extends ContainerBase /** * Return the servlet context with which this servlet is associated. */ + @Override public ServletContext getServletContext() { if (parent == null) @@ -1414,6 +1446,7 @@ public class StandardWrapper extends ContainerBase /** * Return the name of this servlet. */ + @Override public String getServletName() { return (getName()); @@ -1463,6 +1496,7 @@ public class StandardWrapper extends ContainerBase /** * Increment the error count used for monitoring. */ + @Override public void incrementErrorCount(){ swValve.setErrorCount(swValve.getErrorCount() + 1); } @@ -1479,10 +1513,12 @@ public class StandardWrapper extends ContainerBase return classLoadTime; } + @Override public MultipartConfigElement getMultipartConfigElement() { return multipartConfigElement; } + @Override public void setMultipartConfigElement( MultipartConfigElement multipartConfigElement) { this.multipartConfigElement = multipartConfigElement; @@ -1493,14 +1529,17 @@ public class StandardWrapper extends ContainerBase return asyncSupported; } + @Override public void setAsyncSupported(boolean asyncSupported) { this.asyncSupported = asyncSupported; } + @Override public boolean isEnabled() { return enabled; } + @Override public void setEnabled(boolean enabled) { this.enabled = enabled; } @@ -1582,7 +1621,7 @@ public class StandardWrapper extends ContainerBase /** * Start this component and implement the requirements - * of {@link LifecycleBase#startInternal()}. + * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used @@ -1616,7 +1655,7 @@ public class StandardWrapper extends ContainerBase /** * Stop this component and implement the requirements - * of {@link LifecycleBase#stopInternal()}. + * of {@link org.apache.catalina.util.LifecycleBase#stopInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used @@ -1718,6 +1757,7 @@ public class StandardWrapper extends ContainerBase /* Remove a JMX notficationListener * @see javax.management.NotificationEmitter#removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) */ + @Override public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object object) throws ListenerNotFoundException { broadcaster.removeNotificationListener(listener,filter,object); @@ -1730,6 +1770,7 @@ public class StandardWrapper extends ContainerBase * @TODO This two events we not send j2ee.state.failed and j2ee.attribute.changed! * @see javax.management.NotificationBroadcaster#getNotificationInfo() */ + @Override public MBeanNotificationInfo[] getNotificationInfo() { if(notificationInfo == null) { @@ -1774,6 +1815,7 @@ public class StandardWrapper extends ContainerBase /* Add a JMX-NotificationListener * @see javax.management.NotificationBroadcaster#addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) */ + @Override public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object object) throws IllegalArgumentException { broadcaster.addNotificationListener(listener,filter,object); @@ -1784,6 +1826,7 @@ public class StandardWrapper extends ContainerBase * Remove a JMX-NotificationListener * @see javax.management.NotificationBroadcaster#removeNotificationListener(javax.management.NotificationListener) */ + @Override public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException { broadcaster.removeNotificationListener(listener);