This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new ea8a02a5e9 Cleanups ea8a02a5e9 is described below commit ea8a02a5e96f44250e93ce2d7d932132bf7f6e1a Author: remm <r...@apache.org> AuthorDate: Tue Mar 25 15:41:52 2025 +0100 Cleanups --- .../apache/catalina/ant/BaseRedirectorHelperTask.java | 8 ++++---- .../apache/catalina/ant/jmx/JMXAccessorCreateTask.java | 8 ++++---- .../apache/catalina/ant/jmx/JMXAccessorInvokeTask.java | 2 +- .../apache/catalina/ant/jmx/JMXAccessorQueryTask.java | 3 +-- .../org/apache/catalina/ant/jmx/JMXAccessorSetTask.java | 4 ++-- .../catalina/ant/jmx/JMXAccessorUnregisterTask.java | 3 +-- .../apache/catalina/authenticator/SSLAuthenticator.java | 4 ++-- .../jaspic/PersistentProviderRegistrations.java | 2 +- .../apache/catalina/connector/ClientAbortException.java | 3 +++ java/org/apache/catalina/connector/OutputBuffer.java | 4 ++-- java/org/apache/catalina/connector/Request.java | 8 ++++---- java/org/apache/catalina/core/StandardContext.java | 10 +++++----- java/org/apache/catalina/core/StandardHost.java | 2 +- java/org/apache/catalina/core/StandardWrapper.java | 2 +- java/org/apache/catalina/filters/Constants.java | 2 +- java/org/apache/catalina/filters/CorsFilter.java | 11 +++++------ .../apache/catalina/ha/deploy/FileMessageFactory.java | 2 +- .../apache/catalina/loader/WebappClassLoaderBase.java | 2 +- java/org/apache/catalina/manager/JspHelper.java | 6 +++--- java/org/apache/catalina/mapper/Mapper.java | 4 ++-- java/org/apache/catalina/mapper/WrapperMappingInfo.java | 2 +- java/org/apache/catalina/mbeans/ServiceMBean.java | 2 +- java/org/apache/catalina/realm/JNDIRealm.java | 16 ++++++++-------- java/org/apache/catalina/realm/RealmBase.java | 2 +- java/org/apache/catalina/realm/UserDatabaseRealm.java | 2 +- java/org/apache/catalina/servlets/CGIServlet.java | 2 +- java/org/apache/catalina/servlets/WebdavServlet.java | 17 ++--------------- java/org/apache/catalina/session/StoreBase.java | 4 ++-- java/org/apache/catalina/ssi/ExpressionParseTree.java | 2 +- java/org/apache/catalina/startup/ContextConfig.java | 8 ++++---- java/org/apache/catalina/startup/EngineRuleSet.java | 2 +- java/org/apache/catalina/util/TimeBucketCounter.java | 2 +- 32 files changed, 69 insertions(+), 82 deletions(-) diff --git a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java index 0316faad45..b8680ae924 100644 --- a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java +++ b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java @@ -30,7 +30,7 @@ import org.apache.tools.ant.types.RedirectorElement; /** * Abstract base class to add output redirection support for Catalina Ant tasks. These tasks require Ant 1.5 or later. * <br> - * <strong>WARNING:</strong> due to depends chain, Ant could call a Task more than once and this can affect the output + * <strong>WARNING:</strong> due to dependency chain, Ant could call a Task more than once and this can affect the output * redirection when configured. If you are collecting the output in a property, it will collect the output of only the * first run, since Ant properties are immutable and once created they cannot be changed. <br> * If you are collecting output in a file the file will be overwritten with the output of the last run, unless you set @@ -63,7 +63,7 @@ public abstract class BaseRedirectorHelperTask extends Task { /** * Whether to fail (with a BuildException) if ManagerServlet returns an error. The default behavior is to do so. <b> * This flag does not control parameters checking. If the task is called with wrong or invalid parameters, it will - * throw BuildException independently from the setting of this flag. </b> + * throw a BuildException regardless of the setting of this flag. </b> */ protected boolean failOnError = true; @@ -218,7 +218,7 @@ public abstract class BaseRedirectorHelperTask extends Task { redirectOutput = true; } /* - * Due to depends chain, Ant could call the Task more than once, this is to prevent that we attempt to configure + * Due to dependency chain, Ant could call the Task more than once, this is to prevent that we attempt to configure * uselessly more than once the Redirector. */ redirectorConfigured = true; @@ -256,7 +256,7 @@ public abstract class BaseRedirectorHelperTask extends Task { log("Error closing redirector: " + ioe.getMessage(), Project.MSG_ERR); } /* - * Due to depends chain, Ant could call the Task more than once, this is to prevent that we attempt to reuse the + * Due to dependency chain, Ant could call the Task more than once, this is to prevent that we attempt to reuse the * previously closed Streams. */ redirectOutStream = null; diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java index 61668aaf27..4f53548767 100644 --- a/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java +++ b/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java @@ -46,11 +46,11 @@ import org.apache.tools.ant.BuildException; * </jmxCreate/> * </pre> * <p> - * <b>WARNING</b>Not all Tomcat MBeans can create remotely and autoregister by its parents! Please, use the MBeanFactory + * <b>WARNING</b>Not all Tomcat MBeans can create remotely and auto register by its parents! Please, use the MBeanFactory * operation to generate valves and realms. * </p> * <p> - * First call to a remote MBeanserver save the JMXConnection a reference <em>jmx.server</em> + * First call to a remote MBean server save the JMXConnection a reference <em>jmx.server</em> * </p> * These tasks require Ant 1.6 or later interface. * @@ -137,8 +137,8 @@ public class JMXAccessorCreateTask extends JMXAccessorTask { * @throws Exception Error creating MBean */ protected void jmxCreate(MBeanServerConnection jmxServerConnection, String name) throws Exception { - Object argsA[] = null; - String sigA[] = null; + Object[] argsA = null; + String[] sigA = null; if (args != null) { argsA = new Object[args.size()]; sigA = new String[args.size()]; diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java index 872fa09f28..687ea62318 100644 --- a/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java +++ b/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java @@ -29,7 +29,7 @@ import org.apache.tools.ant.BuildException; /** * Access <em>JMX</em> JSR 160 MBeans Server. * <ul> - * <li>open more then one JSR 160 rmi connection</li> + * <li>open more than one JSR 160 rmi connection</li> * <li>Get/Set Mbeans attributes</li> * <li>Call Mbean Operation with arguments</li> * <li>Argument values can be converted from string to int,long,float,double,boolean,ObjectName or InetAddress</li> diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java index 00e4acb05b..5eaa52de87 100644 --- a/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java +++ b/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java @@ -101,7 +101,6 @@ public class JMXAccessorQueryTask extends JMXAccessorTask { * @return null (no error message to report other than exception) */ protected String jmxQuery(MBeanServerConnection jmxServerConnection, String qry) { - String isError = null; Set<ObjectName> names; String resultproperty = getResultproperty(); try { @@ -128,7 +127,7 @@ public class JMXAccessorQueryTask extends JMXAccessorTask { } } } - return isError; + return null; } protected void bindAttributes(MBeanServerConnection jmxServerConnection, String pname, ObjectName oname) { diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java index ec84247267..713a995063 100644 --- a/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java +++ b/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java @@ -34,7 +34,7 @@ import org.apache.tools.ant.BuildException; * <li>Bind Get result as Ant properties</li> * </ul> * <p> - * Examples: Set an Mbean Manager attribute maxActiveSessions. Set this attribute with fresh jmx connection without save + * Examples: Set a Mbean Manager attribute maxActiveSessions. Set this attribute with fresh jmx connection without save * reference * </p> * @@ -51,7 +51,7 @@ import org.apache.tools.ant.BuildException; * /> * </pre> * <p> - * First call to a remote MBeanserver save the JMXConnection a referenz <em>jmx.server</em> + * First call to a remote MBean server save the JMXConnection a reference <em>jmx.server</em> * </p> * These tasks require Ant 1.6 or later interface. * diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java index 4ae2aee5f5..20d0dcbe0c 100644 --- a/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java +++ b/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java @@ -74,12 +74,11 @@ public class JMXAccessorUnregisterTask extends JMXAccessorTask { * @throws Exception An error occurred */ protected String jmxUuregister(MBeanServerConnection jmxServerConnection, String name) throws Exception { - String error = null; if (isEcho()) { handleOutput("Unregister MBean " + name); } jmxServerConnection.unregisterMBean(new ObjectName(name)); - return error; + return null; } } diff --git a/java/org/apache/catalina/authenticator/SSLAuthenticator.java b/java/org/apache/catalina/authenticator/SSLAuthenticator.java index 0f7a50eb59..d7207510d8 100644 --- a/java/org/apache/catalina/authenticator/SSLAuthenticator.java +++ b/java/org/apache/catalina/authenticator/SSLAuthenticator.java @@ -187,8 +187,8 @@ public class SSLAuthenticator extends AuthenticatorBase { // Possibly boundOnInit is used, so use the less accurate protocols enabledProtocols = sslHostConfig.getProtocols().toArray(new String[0]); } - for (String enbabledProtocol : enabledProtocols) { - if (Constants.SSL_PROTO_TLSv1_3.equals(enbabledProtocol)) { + for (String enabledProtocol : enabledProtocols) { + if (Constants.SSL_PROTO_TLSv1_3.equals(enabledProtocol)) { log.warn(sm.getString("sslAuthenticatorValve.tls13", context2.getName(), host.getName(), connector)); } diff --git a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java index aae6b417b1..d8ff871ef1 100644 --- a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java +++ b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java @@ -247,7 +247,7 @@ public final class PersistentProviderRegistrations { /** * Used by IntrospectionUtils via reflection. * - * @param name - the name of of the property to set on this object + * @param name - the name of the property to set on this object * @param value - the value to set * * @see #addProperty(String, String) diff --git a/java/org/apache/catalina/connector/ClientAbortException.java b/java/org/apache/catalina/connector/ClientAbortException.java index 0ee9edca38..1361369468 100644 --- a/java/org/apache/catalina/connector/ClientAbortException.java +++ b/java/org/apache/catalina/connector/ClientAbortException.java @@ -16,6 +16,8 @@ */ package org.apache.catalina.connector; +import java.io.Serial; + import org.apache.coyote.BadRequestException; /** @@ -25,6 +27,7 @@ import org.apache.coyote.BadRequestException; */ public final class ClientAbortException extends BadRequestException { + @Serial private static final long serialVersionUID = 1L; diff --git a/java/org/apache/catalina/connector/OutputBuffer.java b/java/org/apache/catalina/connector/OutputBuffer.java index 70039f8e4a..04ee29c74e 100644 --- a/java/org/apache/catalina/connector/OutputBuffer.java +++ b/java/org/apache/catalina/connector/OutputBuffer.java @@ -419,7 +419,7 @@ public class OutputBuffer extends Writer { /* * Handle the requirements of section 5.7 of the Servlet specification - Closure of the Response Object. * - * Currently this just handles the simple case. There is work in progress to better define what should happen if + * Currently, this just handles the simple case. There is work in progress to better define what should happen if * an attempt is made to write > content-length bytes. When that work is complete, this is likely where the * implementation will end up. */ @@ -454,7 +454,7 @@ public class OutputBuffer extends Writer { // moment but there is a leftover character in the converter // which must be part of a surrogate pair. The byte buffer does // not have enough space left to output the bytes for this pair - // once it is complete )it will require 4 bytes) so flush now to + // once it is complete (it will require 4 bytes) so flush now to // prevent the bytes for the leftover char and the rest of the // surrogate pair yet to be written from being lost. // See TestOutputBuffer#testUtf8SurrogateBody() diff --git a/java/org/apache/catalina/connector/Request.java b/java/org/apache/catalina/connector/Request.java index c0b12a95b5..a2c1808466 100644 --- a/java/org/apache/catalina/connector/Request.java +++ b/java/org/apache/catalina/connector/Request.java @@ -922,7 +922,7 @@ public class Request implements HttpServletRequest { * {@inheritDoc} * <p> * The attribute names returned will only be those for the attributes set via {@link #setAttribute(String, Object)}. - * Tomcat internal attributes will not be included although they are accessible via {@link #getAttribute(String)}. + * Tomcat internal attributes will not be included even though they are accessible via {@link #getAttribute(String)}. * The Tomcat internal attributes include: * <ul> * <li>{@link Globals#DISPATCHER_TYPE_ATTR}</li> @@ -1855,8 +1855,8 @@ public class Request implements HttpServletRequest { int pos = 0; if (!getContext().getAllowMultipleLeadingForwardSlashInPath()) { // Ensure that the returned value only starts with a single '/'. - // This prevents the value being misinterpreted as a protocol- - // relative URI if used with sendRedirect(). + // This prevents the value being misinterpreted as a protocol-relative + // URI if used with sendRedirect(). do { pos++; } while (pos < uri.length() && uri.charAt(pos) == '/'); @@ -2613,7 +2613,7 @@ public class Request implements HttpServletRequest { } else if (("/".equals(context.getSessionCookiePath()) && isRequestedSessionIdFromCookie())) { /* * This is the common(ish) use case: using the same session ID with multiple web applications on the same - * host. Typically this is used by Portlet implementations. It only works if sessions are tracked via + * host. Typically, this is used by Portlet implementations. It only works if sessions are tracked via * cookies. The cookie must have a path of "/" else it won't be provided for requests to all web * applications. * diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java index b1a46ca3f4..d38701b60d 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -239,7 +239,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat /** - * The broadcaster that sends j2ee notifications. + * The broadcaster that sends EE notifications. */ private final NotificationBroadcasterSupport broadcaster; @@ -1354,7 +1354,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat /** * {@inheritDoc} Note that this implementation is not thread safe. If two threads call this method concurrently, the - * result may be either set of listeners or a the union of both. + * result may be either set of listeners or the union of both. */ @Override public void setApplicationEventListeners(Object[] listeners) { @@ -4308,7 +4308,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat cl.setNotFoundClassResourceCacheSize(getNotFoundClassResourceCacheSize()); } - // By calling unbindThread and bindThread in a row, we setup the + // By calling unbindThread and bindThread in a row, we set up the // current Thread CCL to be the webapp classloader unbindThread(oldCCL); oldCCL = bindThread(); @@ -4635,7 +4635,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat } // Once the state is set to STOPPING, the Context will report itself as - // not available and any in progress async requests will timeout + // not available and any in progress async requests will time out setState(LifecycleState.STOPPING); // Binding thread @@ -4743,7 +4743,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat /** * Destroy needs to clean up the context completely. The problem is that undoing all the config in start() and * restoring a 'fresh' state is impossible. After stop()/destroy()/init()/start() we should have the same state as - * if a fresh start was done - i.e read modified web.xml, etc. This can only be done by completely removing the + * if a fresh start was done - i.e. read modified web.xml, etc. This can only be done by completely removing the * context object and remapping a new one, or by cleaning up everything. */ @Override diff --git a/java/org/apache/catalina/core/StandardHost.java b/java/org/apache/catalina/core/StandardHost.java index d789fed7b9..00c66d3425 100644 --- a/java/org/apache/catalina/core/StandardHost.java +++ b/java/org/apache/catalina/core/StandardHost.java @@ -655,7 +655,7 @@ public class StandardHost extends ContainerBase implements Host { /** - * Used to ensure the regardless of {@link Context} implementation, a record is kept of the class loader used every + * Used to ensure that regardless of {@link Context} implementation, a record is kept of the class loader used every * time a context starts. */ private class MemoryLeakTrackingListener implements LifecycleListener { diff --git a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java index 277a7b839f..af5ce6243e 100644 --- a/java/org/apache/catalina/core/StandardWrapper.java +++ b/java/org/apache/catalina/core/StandardWrapper.java @@ -100,7 +100,7 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra protected long available = 0L; /** - * The broadcaster that sends j2ee notifications. + * The broadcaster that sends EE notifications. */ protected final NotificationBroadcasterSupport broadcaster; diff --git a/java/org/apache/catalina/filters/Constants.java b/java/org/apache/catalina/filters/Constants.java index dbec2a72cc..a0b8edb1a1 100644 --- a/java/org/apache/catalina/filters/Constants.java +++ b/java/org/apache/catalina/filters/Constants.java @@ -30,7 +30,7 @@ public final class Constants { public static final String CSRF_NONCE_SESSION_ATTR_NAME = "org.apache.catalina.filters.CSRF_NONCE"; /** - * The request attribute key under which the current requests's CSRF nonce can be found. + * The request attribute key under which the current request's CSRF nonce can be found. */ public static final String CSRF_NONCE_REQUEST_ATTR_NAME = "org.apache.catalina.filters.CSRF_REQUEST_NONCE"; diff --git a/java/org/apache/catalina/filters/CorsFilter.java b/java/org/apache/catalina/filters/CorsFilter.java index 3cf1e42298..8f32bcead9 100644 --- a/java/org/apache/catalina/filters/CorsFilter.java +++ b/java/org/apache/catalina/filters/CorsFilter.java @@ -18,6 +18,7 @@ package org.apache.catalina.filters; import java.io.IOException; import java.io.ObjectInputStream; +import java.io.Serial; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -75,6 +76,7 @@ import org.apache.tomcat.util.res.StringManager; */ public class CorsFilter extends GenericFilter { + @Serial private static final long serialVersionUID = 1L; private static final StringManager sm = StringManager.getManager(CorsFilter.class); @@ -127,14 +129,10 @@ public class CorsFilter extends GenericFilter { @Override public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { - if (!(servletRequest instanceof HttpServletRequest) || !(servletResponse instanceof HttpServletResponse)) { + if (!(servletRequest instanceof HttpServletRequest request) || !(servletResponse instanceof HttpServletResponse response)) { throw new ServletException(sm.getString("corsFilter.onlyHttp")); } - // Safe to downcast at this point. - HttpServletRequest request = (HttpServletRequest) servletRequest; - HttpServletResponse response = (HttpServletResponse) servletResponse; - // Determines the CORS request type. CorsFilter.CORSRequestType requestType = checkRequestType(request); @@ -407,7 +405,7 @@ public class CorsFilter extends GenericFilter { if ("OPTIONS".equals(method)) { // For an OPTIONS request, the response will vary based on the - // value or absence of the following headers. Hence they need be be + // value or absence of the following headers. Hence, they need to be // included in the Vary header. ResponseUtil.addVaryFieldName(response, REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD); ResponseUtil.addVaryFieldName(response, REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS); @@ -767,6 +765,7 @@ public class CorsFilter extends GenericFilter { * Log objects are not Serializable but this Filter is because it extends GenericFilter. Tomcat won't serialize a * Filter but in case something else does... */ + @Serial private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException { ois.defaultReadObject(); log = LogFactory.getLog(CorsFilter.class); diff --git a/java/org/apache/catalina/ha/deploy/FileMessageFactory.java b/java/org/apache/catalina/ha/deploy/FileMessageFactory.java index f1a0e9305f..5208ce56bd 100644 --- a/java/org/apache/catalina/ha/deploy/FileMessageFactory.java +++ b/java/org/apache/catalina/ha/deploy/FileMessageFactory.java @@ -121,7 +121,7 @@ public class FileMessageFactory { /** * Private constructor, either instantiates a factory to read or write. <BR> - * When openForWrite==true, then a the file, f, will be created and an output stream is opened to write to it. <BR> + * When openForWrite==true, then the file f will be created and an output stream is opened to write to it. <BR> * When openForWrite==false, an input stream is opened, the file has to exist. * * @param f File - the file to be read/written diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java b/java/org/apache/catalina/loader/WebappClassLoaderBase.java index 3685b17aae..424c294efa 100644 --- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java +++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java @@ -1553,7 +1553,7 @@ public abstract class WebappClassLoaderBase extends URLClassLoader // when the executor was shut down or the thread was interrupted but // that depends on the thread correctly handling the interrupt. Check // each thread and if any are still running give all threads up to a - // total of 2 seconds to shutdown. + // total of 2 seconds to shut down. int count = 0; for (Thread t : threadsToStop) { while (t.isAlive() && count < 100) { diff --git a/java/org/apache/catalina/manager/JspHelper.java b/java/org/apache/catalina/manager/JspHelper.java index 6d70aeed58..ced139cbec 100644 --- a/java/org/apache/catalina/manager/JspHelper.java +++ b/java/org/apache/catalina/manager/JspHelper.java @@ -28,7 +28,7 @@ import org.apache.tomcat.util.security.Escape; /** - * Helper JavaBean for JSPs, because JSTL 1.1/EL 2.0 is too dumb to to what I need (call methods with parameters), or I + * Helper JavaBean for JSPs, because JSTL 1.1/EL 2.0 is too dumb to do what I need (call methods with parameters), or I * am too dumb to use it correctly. :) * * @author Cédrik LIME @@ -66,11 +66,11 @@ public class JspHelper { } /** - * Try to get user name from the session, if possible. + * Try to get username from the session, if possible. * * @param in_session The Servlet session * - * @return the user name + * @return the username */ public static String guessDisplayUserFromSession(Session in_session) { Object user = SessionUtils.guessUserFromSession(in_session); diff --git a/java/org/apache/catalina/mapper/Mapper.java b/java/org/apache/catalina/mapper/Mapper.java index 233d4f0447..898047ddc7 100644 --- a/java/org/apache/catalina/mapper/Mapper.java +++ b/java/org/apache/catalina/mapper/Mapper.java @@ -855,7 +855,7 @@ public final class Mapper { if (buf[pathEnd - 1] == '/') { /* * Path ending in '/' was mapped to JSP servlet based on wildcard match (e.g., as specified in - * url-pattern of a jsp-property-group. Force the context's welcome files, which are interpreted as + * url-pattern of a jsp-property-group). Force the context's welcome files, which are interpreted as * JSP files (since they match the url-pattern), to be considered. See Bugzilla 27664. */ mappingData.wrapper = null; @@ -931,7 +931,7 @@ public final class Mapper { } /* - * welcome file processing - take 2 Now that we have looked for welcome files with a physical backing, now look + * Welcome file processing - take 2. Now that we have looked for welcome files with a physical backing, now look * for an extension mapping listed but may not have a physical backing to it. This is for the case of index.jsf, * index.do, etc. A watered down version of rule 4 */ diff --git a/java/org/apache/catalina/mapper/WrapperMappingInfo.java b/java/org/apache/catalina/mapper/WrapperMappingInfo.java index aaeaa39233..442f07f30f 100644 --- a/java/org/apache/catalina/mapper/WrapperMappingInfo.java +++ b/java/org/apache/catalina/mapper/WrapperMappingInfo.java @@ -21,7 +21,7 @@ import org.apache.catalina.Wrapper; /** * Encapsulates information used to register a Wrapper mapping. * - * @param mapping The URL pattern) + * @param mapping The URL pattern * @param wrapper The wrapper for the Servlet * @param jspWildCard Is this a mapping for JSP files? * @param resourceOnly Is this a resource only mapping? diff --git a/java/org/apache/catalina/mbeans/ServiceMBean.java b/java/org/apache/catalina/mbeans/ServiceMBean.java index e64d866b85..0a0c06a3b6 100644 --- a/java/org/apache/catalina/mbeans/ServiceMBean.java +++ b/java/org/apache/catalina/mbeans/ServiceMBean.java @@ -53,7 +53,7 @@ public class ServiceMBean extends BaseCatalinaMBean<Service> { /** * Adds a named executor to the service * - * @param type Classname of the Executor to be added + * @param type Class name of the Executor to be added * * @throws MBeanException error creating the executor */ diff --git a/java/org/apache/catalina/realm/JNDIRealm.java b/java/org/apache/catalina/realm/JNDIRealm.java index decf3b1885..0b8bf3c4f1 100644 --- a/java/org/apache/catalina/realm/JNDIRealm.java +++ b/java/org/apache/catalina/realm/JNDIRealm.java @@ -1149,7 +1149,7 @@ public class JNDIRealm extends RealmBase { try { - // Occasionally the directory context will timeout. Try one more + // Occasionally the directory context will time out. Try one more // time before giving up. // Authenticate the specified username if possible @@ -1158,7 +1158,7 @@ public class JNDIRealm extends RealmBase { } catch (NullPointerException | NamingException e) { /* * BZ 61313 NamingException may or may not indicate an error that is recoverable via fail over. - * Therefore a decision needs to be made whether to fail over or not. Generally, attempting to fail over + * Therefore, a decision needs to be made whether to fail over or not. Generally, attempting to fail over * when it is not appropriate is better than not failing over when it is appropriate so the code always * attempts to fail over for NamingExceptions. */ @@ -1264,9 +1264,9 @@ public class JNDIRealm extends RealmBase { // Log the problem for posterity containerLog.warn(sm.getString("jndiRealm.exception"), ine); // ignore; this is probably due to a name not fitting - // the search path format exactly, as in a fully- - // qualified name being munged into a search path - // that already contains cn= or vice-versa + // the search path format exactly, as in a fully-qualified + // name being munged into a search path + // that already contains cn= or vice versa } } } @@ -1745,7 +1745,7 @@ public class JNDIRealm extends RealmBase { /** * Check whether the given User can be authenticated with the given credentials. If the <code>userPassword</code> * configuration attribute is specified, the credentials previously retrieved from the directory are compared - * explicitly with those presented by the user. Otherwise the presented credentials are checked by binding to the + * explicitly with those presented by the user. Otherwise, the presented credentials are checked by binding to the * directory as the user. * * @param context The directory context @@ -2269,7 +2269,7 @@ public class JNDIRealm extends RealmBase { // Ensure that we have a directory context available connection = get(); - // Occasionally the directory context will timeout. Try one more + // Occasionally the directory context will time out. Try one more // time before giving up. try { user = getUser(connection, username, null); @@ -2340,7 +2340,7 @@ public class JNDIRealm extends RealmBase { // Ensure that we have a directory context available connection = get(); - // Occasionally the directory context will timeout. Try one more + // Occasionally the directory context will time out. Try one more // time before giving up. try { diff --git a/java/org/apache/catalina/realm/RealmBase.java b/java/org/apache/catalina/realm/RealmBase.java index a619b377ac..37c758150c 100644 --- a/java/org/apache/catalina/realm/RealmBase.java +++ b/java/org/apache/catalina/realm/RealmBase.java @@ -1244,7 +1244,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { /** * Return the Server object that is the ultimate parent for the container with which this Realm is associated. If - * the server cannot be found (eg because the container hierarchy is not complete), <code>null</code> is returned. + * the server cannot be found (e.g. because the container hierarchy is not complete), <code>null</code> is returned. * * @return the Server associated with the realm */ diff --git a/java/org/apache/catalina/realm/UserDatabaseRealm.java b/java/org/apache/catalina/realm/UserDatabaseRealm.java index f9603febc3..f392ab7355 100644 --- a/java/org/apache/catalina/realm/UserDatabaseRealm.java +++ b/java/org/apache/catalina/realm/UserDatabaseRealm.java @@ -113,7 +113,7 @@ public class UserDatabaseRealm extends RealmBase { * Determines whether this Realm is configured to obtain the associated {@link UserDatabase} from the global JNDI * context or a local (web application) JNDI context. * - * @return {@code true} if a local JNDI context will be used, {@code false} if the the global JNDI context will be + * @return {@code true} if a local JNDI context will be used, {@code false} if the global JNDI context will be * used */ public boolean getLocalJndiResource() { diff --git a/java/org/apache/catalina/servlets/CGIServlet.java b/java/org/apache/catalina/servlets/CGIServlet.java index 428fdbf734..1b468d0668 100644 --- a/java/org/apache/catalina/servlets/CGIServlet.java +++ b/java/org/apache/catalina/servlets/CGIServlet.java @@ -1421,7 +1421,7 @@ public final class CGIServlet extends HttpServlet { * * @exception IOException if problems during reading/writing occur * - * @see java.lang.Runtime#exec(String command, String[] envp, File dir) + * @see java.lang.Runtime#exec(String[] command, String[] envp, File dir) */ protected void run() throws IOException { diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java b/java/org/apache/catalina/servlets/WebdavServlet.java index 11e291dc3d..b83ecdbd9e 100644 --- a/java/org/apache/catalina/servlets/WebdavServlet.java +++ b/java/org/apache/catalina/servlets/WebdavServlet.java @@ -2786,21 +2786,8 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen @Override public String toString() { - - StringBuilder result = new StringBuilder("Type:"); - result.append(type); - result.append("\nScope:"); - result.append(scope); - result.append("\nDepth:"); - result.append(depth); - result.append("\nOwner:"); - result.append(owner); - result.append("\nExpiration:"); - result.append(FastHttpDateFormat.formatDate(expiresAt)); - result.append("\nToken:"); - result.append(token); - result.append("\n"); - return result.toString(); + return "Type:" + type + "\nScope:" + scope + "\nDepth:" + String.valueOf(depth) + "\nOwner:" + owner + + "\nExpiration:" + FastHttpDateFormat.formatDate(expiresAt) + "\nToken:" + token + "\n"; } diff --git a/java/org/apache/catalina/session/StoreBase.java b/java/org/apache/catalina/session/StoreBase.java index 81791a0f63..86e9148277 100644 --- a/java/org/apache/catalina/session/StoreBase.java +++ b/java/org/apache/catalina/session/StoreBase.java @@ -182,10 +182,10 @@ public abstract class StoreBase extends LifecycleBase implements Store { // --------------------------------------------------------- Protected Methods /** - * Create the object input stream to use to read a session from the store. Sub-classes <b>must</b> have set the + * Create the object input stream to use to read a session from the store. Subclasses <b>must</b> have set the * thread context class loader before calling this method. * - * @param is The input stream provided by the sub-class that will provide the data for a session + * @param is The input stream provided by the subclass that will provide the data for a session * * @return An appropriately configured ObjectInputStream from which the session can be read. * diff --git a/java/org/apache/catalina/ssi/ExpressionParseTree.java b/java/org/apache/catalina/ssi/ExpressionParseTree.java index 4376a656c9..afed22c729 100644 --- a/java/org/apache/catalina/ssi/ExpressionParseTree.java +++ b/java/org/apache/catalina/ssi/ExpressionParseTree.java @@ -180,7 +180,7 @@ public class ExpressionParseTree { break; case ExpressionTokenizer.TOKEN_NOT_EQ: pushOpp(new NotNode()); - // Sneak the regular node in. The NOT will + // Sneak the regular node in. They will NOT // be resolved when the next opp comes along. oppStack.addFirst(new EqualNode()); break; diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java index d29f3cbdd1..5feb7e9db5 100644 --- a/java/org/apache/catalina/startup/ContextConfig.java +++ b/java/org/apache/catalina/startup/ContextConfig.java @@ -799,7 +799,7 @@ public class ContextConfig implements LifecycleListener { } // At this point we need to determine if we have a WAR file in the - // appBase that needs to be expanded. Therefore we consider the absolute + // appBase that needs to be expanded. Therefore, we consider the absolute // docBase NOT the canonical docBase. This is because some users symlink // WAR files into the appBase and we want this to work correctly. boolean docBaseAbsoluteInAppBase = docBaseAbsolute.startsWith(appBase.getPath() + File.separatorChar); @@ -915,7 +915,7 @@ public class ContextConfig implements LifecycleListener { /** - * Process a "init" event for this Context. + * Process an "init" event for this Context. */ protected synchronized void init() { // Called from StandardContext.init() @@ -2468,7 +2468,7 @@ public class ContextConfig implements LifecycleListener { } } if (servletName == null) { - // classname is default servletName as annotation has no name! + // class name is default servletName as annotation has no name! servletName = className; } ServletDef servletDef = fragment.getServlets().get(servletName); @@ -2568,7 +2568,7 @@ public class ContextConfig implements LifecycleListener { } } if (filterName == null) { - // classname is default filterName as annotation has no name! + // class name is default filterName as annotation has no name! filterName = className; } FilterDef filterDef = fragment.getFilters().get(filterName); diff --git a/java/org/apache/catalina/startup/EngineRuleSet.java b/java/org/apache/catalina/startup/EngineRuleSet.java index 5f6b37a56e..c1720c6ecb 100644 --- a/java/org/apache/catalina/startup/EngineRuleSet.java +++ b/java/org/apache/catalina/startup/EngineRuleSet.java @@ -20,7 +20,7 @@ import org.apache.tomcat.util.digester.Digester; import org.apache.tomcat.util.digester.RuleSet; /** - * <strong>RuleSet</strong> for processing the contents of a Engine definition element. This <code>RuleSet</code> does + * <strong>RuleSet</strong> for processing the contents of an Engine definition element. This <code>RuleSet</code> does * NOT include any rules for nested Host elements, which should be added via instances of <code>HostRuleSet</code>. * * @author Craig R. McClanahan diff --git a/java/org/apache/catalina/util/TimeBucketCounter.java b/java/org/apache/catalina/util/TimeBucketCounter.java index e647add4e4..157442e4cb 100644 --- a/java/org/apache/catalina/util/TimeBucketCounter.java +++ b/java/org/apache/catalina/util/TimeBucketCounter.java @@ -92,7 +92,7 @@ public class TimeBucketCounter extends TimeBucketCounterBase { * * @return the actual bucket duration in seconds * - * @see FastTimeBucketCounter#determineShiftBitsOfDuration(int) + * @see TimeBucketCounter#determineShiftBitsOfDuration(int) */ private static int getActualDuration(int duration) { return (int) (1L << determineShiftBitsOfDuration(duration)) / 1000; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org