This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new b14ad16883 Re-apply automatic formatting excluding forks of Commons projects b14ad16883 is described below commit b14ad168836f8273bd4d63505e519780430e62a7 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Aug 29 12:28:28 2025 +0100 Re-apply automatic formatting excluding forks of Commons projects --- java/jakarta/servlet/http/HttpServletRequest.java | 7 +- .../catalina/ant/BaseRedirectorHelperTask.java | 14 +- java/org/apache/catalina/ant/DeployTask.java | 2 +- .../catalina/ant/jmx/JMXAccessorCreateTask.java | 4 +- .../catalina/ant/jmx/JMXAccessorInvokeTask.java | 10 +- .../catalina/authenticator/FormAuthenticator.java | 9 +- .../catalina/authenticator/SSLAuthenticator.java | 3 +- .../jaspic/AuthConfigFactoryImpl.java | 2 +- java/org/apache/catalina/core/StandardContext.java | 3 +- .../catalina/deploy/NamingResourcesImpl.java | 8 +- java/org/apache/catalina/filters/CorsFilter.java | 7 +- .../org/apache/catalina/filters/ExpiresFilter.java | 2 +- .../apache/catalina/filters/RemoteIpFilter.java | 31 +++-- .../apache/catalina/ha/session/DeltaRequest.java | 5 +- .../apache/catalina/ha/session/SessionMessage.java | 4 +- .../apache/catalina/ha/tcp/ReplicationValve.java | 3 +- .../catalina/loader/WebappClassLoaderBase.java | 2 +- .../catalina/manager/HTMLManagerServlet.java | 20 +++ .../apache/catalina/manager/ManagerServlet.java | 9 +- java/org/apache/catalina/mbeans/MBeanUtils.java | 10 +- java/org/apache/catalina/realm/JNDIRealm.java | 12 +- java/org/apache/catalina/realm/LockOutRealm.java | 2 +- java/org/apache/catalina/realm/NullRealm.java | 4 +- .../apache/catalina/realm/UserDatabaseRealm.java | 3 +- .../apache/catalina/security/SecurityListener.java | 3 +- .../apache/catalina/servlets/DefaultServlet.java | 9 +- .../apache/catalina/servlets/WebdavServlet.java | 8 +- .../catalina/ssi/SSIServletExternalResolver.java | 4 +- .../catalina/startup/CatalinaProperties.java | 2 +- java/org/apache/catalina/storeconfig/LoaderSF.java | 2 +- .../apache/catalina/storeconfig/StoreAppender.java | 6 +- .../apache/catalina/tribes/ChannelInterceptor.java | 4 +- .../group/interceptors/NonBlockingCoordinator.java | 4 +- .../org/apache/catalina/tribes/io/ChannelData.java | 4 +- .../tribes/membership/McastServiceImpl.java | 4 +- .../membership/StaticMembershipProvider.java | 4 +- .../cloud/KubernetesMembershipProvider.java | 2 +- .../tribes/tipis/AbstractReplicatedMap.java | 19 ++- .../apache/catalina/users/MemoryUserDatabase.java | 4 +- java/org/apache/catalina/util/Introspection.java | 2 +- java/org/apache/catalina/util/LifecycleBase.java | 4 +- java/org/apache/catalina/util/RateLimiterBase.java | 4 +- .../catalina/util/TimeBucketCounterBase.java | 6 +- java/org/apache/catalina/util/XMLWriter.java | 4 +- .../catalina/valves/AbstractAccessLogValve.java | 3 +- .../apache/catalina/valves/ErrorReportValve.java | 3 +- .../catalina/valves/ExtendedAccessLogValve.java | 6 +- .../catalina/valves/JsonErrorReportValve.java | 7 +- .../catalina/valves/ParameterLimitValve.java | 6 +- java/org/apache/catalina/valves/RemoteIpValve.java | 15 +-- .../valves/rewrite/QuotedStringTokenizer.java | 2 +- .../catalina/valves/rewrite/RewriteValve.java | 5 +- java/org/apache/catalina/webresources/Cache.java | 5 +- java/org/apache/coyote/CompressionConfig.java | 6 +- java/org/apache/coyote/Request.java | 4 +- java/org/apache/coyote/ajp/AjpProcessor.java | 6 +- java/org/apache/el/lang/ELSupport.java | 13 +- java/org/apache/jasper/Options.java | 2 +- java/org/apache/jasper/compiler/Compiler.java | 4 +- .../apache/jasper/compiler/ELFunctionMapper.java | 3 +- java/org/apache/jasper/compiler/Generator.java | 141 ++++++++++----------- java/org/apache/jasper/compiler/JavaCompiler.java | 11 +- .../apache/jasper/compiler/JspDocumentParser.java | 4 +- java/org/apache/jasper/compiler/JspReader.java | 6 +- java/org/apache/jasper/compiler/Node.java | 4 +- java/org/apache/jasper/compiler/PageInfo.java | 3 +- java/org/apache/jasper/compiler/Parser.java | 4 +- java/org/apache/jasper/compiler/Validator.java | 2 +- .../compiler/tagplugin/TagPluginContext.java | 4 +- .../org/apache/jasper/runtime/BodyContentImpl.java | 4 +- .../apache/jasper/runtime/JspRuntimeLibrary.java | 10 +- java/org/apache/jasper/runtime/JspWriterImpl.java | 6 +- java/org/apache/jasper/servlet/JspServlet.java | 7 +- .../apache/jasper/servlet/JspServletWrapper.java | 10 +- .../concurrent/KeyedReentrantReadWriteLock.java | 4 +- .../apache/tomcat/util/net/SecureNioChannel.java | 2 +- java/org/apache/tomcat/util/net/jsse/PEMFile.java | 3 +- 77 files changed, 307 insertions(+), 283 deletions(-) diff --git a/java/jakarta/servlet/http/HttpServletRequest.java b/java/jakarta/servlet/http/HttpServletRequest.java index a89adc30f8..ba68a72ec0 100644 --- a/java/jakarta/servlet/http/HttpServletRequest.java +++ b/java/jakarta/servlet/http/HttpServletRequest.java @@ -294,8 +294,8 @@ public interface HttpServletRequest extends ServletRequest { String getRequestedSessionId(); /** - * Returns the URI path part of this request's URL which starts after the authority (if any) and ends before the query - * string delimiter ({@code ?}), if any. The web container does not decode this String. For example: + * Returns the URI path part of this request's URL which starts after the authority (if any) and ends before the + * query string delimiter ({@code ?}), if any. The web container does not decode this String. For example: * <table> * <caption>Examples of Returned Values</caption> * <tr> @@ -317,7 +317,8 @@ public interface HttpServletRequest extends ServletRequest { * <p> * To reconstruct a URL with a scheme and host, use {@link #getRequestURL}. * - * @return a <code>String</code> containing the path part of the URL from after the authority to before the query string + * @return a <code>String</code> containing the path part of the URL from after the authority to before the query + * string * * @see #getRequestURL */ diff --git a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java index b8680ae924..d388856551 100644 --- a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java +++ b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java @@ -30,9 +30,9 @@ 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 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> + * <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 * append="true", in which case each run will append it's output to the file. * @@ -218,8 +218,8 @@ public abstract class BaseRedirectorHelperTask extends Task { redirectOutput = true; } /* - * 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. + * 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,8 +256,8 @@ public abstract class BaseRedirectorHelperTask extends Task { log("Error closing redirector: " + ioe.getMessage(), Project.MSG_ERR); } /* - * 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. + * 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; redirectOutPrintStream = null; diff --git a/java/org/apache/catalina/ant/DeployTask.java b/java/org/apache/catalina/ant/DeployTask.java index d1e8ff19d8..404c6b7585 100644 --- a/java/org/apache/catalina/ant/DeployTask.java +++ b/java/org/apache/catalina/ant/DeployTask.java @@ -149,7 +149,7 @@ public class DeployTask extends AbstractCatalinaCommandTask { if (fsInput != null) { try { fsInput.close(); - } catch (IOException ignore ) { + } catch (IOException ignore) { // Ignore } } diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java index 4f53548767..36ba5c6c4a 100644 --- a/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java +++ b/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java @@ -46,8 +46,8 @@ import org.apache.tools.ant.BuildException; * </jmxCreate/> * </pre> * <p> - * <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. + * <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 MBean server save the JMXConnection a reference <em>jmx.server</em> diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java index 687ea62318..45d45ae53a 100644 --- a/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java +++ b/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java @@ -54,6 +54,7 @@ import org.apache.tools.ant.BuildException; * * </li> * <li>Create new AccessLogger at localhost + * * <pre> * <jmx:invoke * name="Catalina:type=MBeanFactory" @@ -61,15 +62,20 @@ import org.apache.tools.ant.BuildException; * resultproperty="accessLoggerObjectName"> * <arg value="Catalina:type=Host,host=localhost"/> * </jmx:invoke> - * </pre></li> + * </pre> + * + * </li> * <li>Remove existing AccessLogger at localhost + * * <pre> * <jmx:invoke * name="Catalina:type=MBeanFactory" * operation="removeValve"> * <arg value="Catalina:type=Valve,name=AccessLogValve,host=localhost"/> * </jmx:invoke> - * </pre></li> + * </pre> + * + * </li> * </ul> * <p> * First call to a remote MBeanserver save the JMXConnection a referenz <em>jmx.server</em> diff --git a/java/org/apache/catalina/authenticator/FormAuthenticator.java b/java/org/apache/catalina/authenticator/FormAuthenticator.java index e9056e2c8c..1ec8022a7d 100644 --- a/java/org/apache/catalina/authenticator/FormAuthenticator.java +++ b/java/org/apache/catalina/authenticator/FormAuthenticator.java @@ -719,16 +719,17 @@ public class FormAuthenticator extends AuthenticatorBase { if (session instanceof HttpSession) { if (((HttpSession) session).isNew()) { int originalMaxInactiveInterval = session.getMaxInactiveInterval(); - if (originalMaxInactiveInterval > getAuthenticationSessionTimeout() || originalMaxInactiveInterval <= 0) { + if (originalMaxInactiveInterval > getAuthenticationSessionTimeout() || + originalMaxInactiveInterval <= 0) { saved.setOriginalMaxInactiveInterval(originalMaxInactiveInterval); session.setMaxInactiveInterval(getAuthenticationSessionTimeout()); } } else if (previousSavedRequest != null && previousSavedRequest.getOriginalMaxInactiveIntervalOptional() != null) { /* - * The user may have refreshed the browser page during authentication. Transfer the original max inactive - * interval from previous saved request to current one else, once authentication is completed, the session - * will retain the shorter authentication session timeout + * The user may have refreshed the browser page during authentication. Transfer the original max + * inactive interval from previous saved request to current one else, once authentication is completed, + * the session will retain the shorter authentication session timeout */ saved.setOriginalMaxInactiveInterval( previousSavedRequest.getOriginalMaxInactiveIntervalOptional().intValue()); diff --git a/java/org/apache/catalina/authenticator/SSLAuthenticator.java b/java/org/apache/catalina/authenticator/SSLAuthenticator.java index 29558c5c4d..b216b6c6db 100644 --- a/java/org/apache/catalina/authenticator/SSLAuthenticator.java +++ b/java/org/apache/catalina/authenticator/SSLAuthenticator.java @@ -203,7 +203,8 @@ public class SSLAuthenticator extends AuthenticatorBase { UpgradeProtocol[] upgradeProtocols = connector.findUpgradeProtocols(); for (UpgradeProtocol upgradeProtocol : upgradeProtocols) { if ("h2".equals(upgradeProtocol.getAlpnName())) { - log.warn(sm.getString("sslAuthenticatorValve.http2", context.getName(), host.getName(), connector)); + log.warn(sm.getString("sslAuthenticatorValve.http2", context.getName(), host.getName(), + connector)); break; } } diff --git a/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java b/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java index e178596448..8705f800af 100644 --- a/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java +++ b/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java @@ -556,7 +556,7 @@ public class AuthConfigFactoryImpl extends AuthConfigFactory { @Override public AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject) - throws AuthException { + throws AuthException { return module.validateRequest(messageInfo, clientSubject, serviceSubject); } diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java index 78c13f03be..ed5f798ef4 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -5349,7 +5349,8 @@ public class StandardContext extends ContainerBase implements Context, Notificat catalinaHomePath = getCatalinaBase().getCanonicalPath(); dir = new File(catalinaHomePath, workDir); } catch (IOException ioe) { - log.warn(sm.getString("standardContext.workCreateException", workDir, getCatalinaBase(), getName()), ioe); + log.warn(sm.getString("standardContext.workCreateException", workDir, getCatalinaBase(), getName()), + ioe); } } if (!dir.mkdirs() && !dir.isDirectory()) { diff --git a/java/org/apache/catalina/deploy/NamingResourcesImpl.java b/java/org/apache/catalina/deploy/NamingResourcesImpl.java index 0afe3d8e93..fb6803363d 100644 --- a/java/org/apache/catalina/deploy/NamingResourcesImpl.java +++ b/java/org/apache/catalina/deploy/NamingResourcesImpl.java @@ -513,8 +513,8 @@ public class NamingResourcesImpl extends LifecycleMBeanBase implements Serializa /** - * @return the array of defined environment entries for this web application. If none have been defined, a zero-length - * array is returned. + * @return the array of defined environment entries for this web application. If none have been defined, a + * zero-length array is returned. */ public ContextEnvironment[] findEnvironments() { @@ -649,8 +649,8 @@ public class NamingResourcesImpl extends LifecycleMBeanBase implements Serializa /** - * @return the array of resource environment reference names for this web application. If none have been specified, a - * zero-length array is returned. + * @return the array of resource environment reference names for this web application. If none have been specified, + * a zero-length array is returned. */ public ContextResourceEnvRef[] findResourceEnvRefs() { diff --git a/java/org/apache/catalina/filters/CorsFilter.java b/java/org/apache/catalina/filters/CorsFilter.java index 99cf493f71..4687c9fe0c 100644 --- a/java/org/apache/catalina/filters/CorsFilter.java +++ b/java/org/apache/catalina/filters/CorsFilter.java @@ -546,7 +546,7 @@ public class CorsFilter extends GenericFilter { if (originHeader.isEmpty() || !RequestUtil.isValidOrigin(originHeader)) { return CORSRequestType.INVALID_CORS; } - if(RequestUtil.isSameOrigin(request, originHeader)) { + if (RequestUtil.isSameOrigin(request, originHeader)) { return CORSRequestType.NOT_CORS; } String method = request.getMethod(); @@ -555,7 +555,8 @@ public class CorsFilter extends GenericFilter { } switch (method) { case "OPTIONS": - String accessControlRequestMethodHeader = request.getHeader(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD); + String accessControlRequestMethodHeader = + request.getHeader(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD); if (accessControlRequestMethodHeader != null) { if (accessControlRequestMethodHeader.isEmpty()) { return CORSRequestType.INVALID_CORS; @@ -892,7 +893,7 @@ public class CorsFilter extends GenericFilter { * @see <a href="http://www.w3.org/TR/cors/#terminology" >http://www.w3.org/TR/cors/#terminology</a> */ public static final Collection<String> SIMPLE_HTTP_REQUEST_CONTENT_TYPE_VALUES = - Set.of(Globals.CONTENT_TYPE_FORM_URL_ENCODING, "multipart/form-data", "text/plain"); + Set.of(Globals.CONTENT_TYPE_FORM_URL_ENCODING, "multipart/form-data", "text/plain"); // ------------------------------------------------ Configuration Defaults /** diff --git a/java/org/apache/catalina/filters/ExpiresFilter.java b/java/org/apache/catalina/filters/ExpiresFilter.java index 5165e7e77f..101b305d4a 100644 --- a/java/org/apache/catalina/filters/ExpiresFilter.java +++ b/java/org/apache/catalina/filters/ExpiresFilter.java @@ -510,7 +510,7 @@ public class ExpiresFilter extends FilterBase { * ({@link StartingPoint#ACCESS_TIME}) or the last time the HTML-page/servlet-response was modified ( * {@link StartingPoint#LAST_MODIFICATION_TIME}). */ - public enum StartingPoint { + public enum StartingPoint { ACCESS_TIME, LAST_MODIFICATION_TIME } diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java b/java/org/apache/catalina/filters/RemoteIpFilter.java index c967dd04fe..094698542c 100644 --- a/java/org/apache/catalina/filters/RemoteIpFilter.java +++ b/java/org/apache/catalina/filters/RemoteIpFilter.java @@ -194,6 +194,7 @@ import org.apache.tomcat.util.res.StringManager; * <p> * XForwardedFilter configuration: * </p> + * * <pre> * <filter> * <filter-name>RemoteIpFilter</filter-name> @@ -220,7 +221,8 @@ import org.apache.tomcat.util.res.StringManager; * <filter-name>RemoteIpFilter</filter-name> * <url-pattern>/*</url-pattern> * <dispatcher>REQUEST</dispatcher> - * </filter-mapping></pre> + * </filter-mapping> + * </pre> * <table border="1"> * <caption>Request Values</caption> * <tr> @@ -273,6 +275,7 @@ import org.apache.tomcat.util.res.StringManager; * <p> * RemoteIpFilter configuration: * </p> + * * <pre> * <filter> * <filter-name>RemoteIpFilter</filter-name> @@ -299,7 +302,8 @@ import org.apache.tomcat.util.res.StringManager; * <filter-name>RemoteIpFilter</filter-name> * <url-pattern>/*</url-pattern> * <dispatcher>REQUEST</dispatcher> - * </filter-mapping></pre> + * </filter-mapping> + * </pre> * <table border="1"> * <caption>Request Values</caption> * <tr> @@ -335,6 +339,7 @@ import org.apache.tomcat.util.res.StringManager; * <p> * RemoteIpFilter configuration: * </p> + * * <pre> * <filter> * <filter-name>RemoteIpFilter</filter-name> @@ -361,7 +366,8 @@ import org.apache.tomcat.util.res.StringManager; * <filter-name>RemoteIpFilter</filter-name> * <url-pattern>/*</url-pattern> * <dispatcher>REQUEST</dispatcher> - * </filter-mapping></pre> + * </filter-mapping> + * </pre> * <table border="1"> * <caption>Request Values</caption> * <tr> @@ -398,6 +404,7 @@ import org.apache.tomcat.util.res.StringManager; * <p> * RemoteIpFilter configuration: * </p> + * * <pre> * <filter> * <filter-name>RemoteIpFilter</filter-name> @@ -424,7 +431,8 @@ import org.apache.tomcat.util.res.StringManager; * <filter-name>RemoteIpFilter</filter-name> * <url-pattern>/*</url-pattern> * <dispatcher>REQUEST</dispatcher> - * </filter-mapping></pre> + * </filter-mapping> + * </pre> * <table border="1"> * <caption>Request Values</caption> * <tr> @@ -742,14 +750,13 @@ public class RemoteIpFilter extends GenericFilter { /** * @see #setInternalProxies(String) */ - private Pattern internalProxies = - Pattern.compile("10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" + "192\\.168\\.\\d{1,3}\\.\\d{1,3}|" + - "169\\.254\\.\\d{1,3}\\.\\d{1,3}|" + "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" + - "100\\.6[4-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "100\\.[7-9]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" + - "100\\.1[0-1]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" + "100\\.12[0-7]{1}\\.\\d{1,3}\\.\\d{1,3}|" + - "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + - "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "0:0:0:0:0:0:0:1|::1|" + - "fe[89ab]\\p{XDigit}:.*|" + "f[cd]\\p{XDigit}{2}+:.*"); + private Pattern internalProxies = Pattern.compile("10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" + + "192\\.168\\.\\d{1,3}\\.\\d{1,3}|" + "169\\.254\\.\\d{1,3}\\.\\d{1,3}|" + + "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" + "100\\.6[4-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + + "100\\.[7-9]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" + "100\\.1[0-1]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" + + "100\\.12[0-7]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + + "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" + + "0:0:0:0:0:0:0:1|::1|" + "fe[89ab]\\p{XDigit}:.*|" + "f[cd]\\p{XDigit}{2}+:.*"); /** * @see #setProtocolHeader(String) diff --git a/java/org/apache/catalina/ha/session/DeltaRequest.java b/java/org/apache/catalina/ha/session/DeltaRequest.java index 5997913baa..6f690b6122 100644 --- a/java/org/apache/catalina/ha/session/DeltaRequest.java +++ b/java/org/apache/catalina/ha/session/DeltaRequest.java @@ -431,9 +431,8 @@ public class DeltaRequest implements Externalizable { @Override public String toString() { - return "AttributeInfo[type=" + getType() + ", action=" + getAction() + - ", name=" + getName() + ", value=" + getValue() + - ", addr=" + super.toString() + ']'; + return "AttributeInfo[type=" + getType() + ", action=" + getAction() + ", name=" + getName() + ", value=" + + getValue() + ", addr=" + super.toString() + ']'; } } diff --git a/java/org/apache/catalina/ha/session/SessionMessage.java b/java/org/apache/catalina/ha/session/SessionMessage.java index 39674f5b89..30aed98017 100644 --- a/java/org/apache/catalina/ha/session/SessionMessage.java +++ b/java/org/apache/catalina/ha/session/SessionMessage.java @@ -47,8 +47,8 @@ public interface SessionMessage extends ClusterMessage { int EVT_SESSION_EXPIRED = 2; /** - * Event type used when a session has been accessed (ie, last access time has been updated). This is used so that the - * replicated sessions will not expire on the network + * Event type used when a session has been accessed (ie, last access time has been updated). This is used so that + * the replicated sessions will not expire on the network */ int EVT_SESSION_ACCESSED = 3; diff --git a/java/org/apache/catalina/ha/tcp/ReplicationValve.java b/java/org/apache/catalina/ha/tcp/ReplicationValve.java index 6a44e1f273..0908593a58 100644 --- a/java/org/apache/catalina/ha/tcp/ReplicationValve.java +++ b/java/org/apache/catalina/ha/tcp/ReplicationValve.java @@ -545,8 +545,7 @@ public class ReplicationValve extends ValveBase implements ClusterValve { Long.valueOf(totalSendTime.longValue() / nrOfRequests.longValue()), Long.valueOf(nrOfRequests.longValue()), Long.valueOf(nrOfSendRequests.longValue()), Long.valueOf(nrOfCrossContextSendRequests.longValue()), - Long.valueOf(nrOfFilterRequests.longValue()), - Long.valueOf(totalRequestTime.longValue()), + Long.valueOf(nrOfFilterRequests.longValue()), Long.valueOf(totalRequestTime.longValue()), Long.valueOf(totalSendTime.longValue()))); } } diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java b/java/org/apache/catalina/loader/WebappClassLoaderBase.java index 578b0eacb3..39ffd49e09 100644 --- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java +++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java @@ -2343,7 +2343,7 @@ public abstract class WebappClassLoaderBase extends URLClassLoader if (pkg != null) { boolean sealCheck = true; if (pkg.isSealed()) { - if(codeBase != null) { + if (codeBase != null) { sealCheck = pkg.isSealed(codeBase); } else { sealCheck = false; diff --git a/java/org/apache/catalina/manager/HTMLManagerServlet.java b/java/org/apache/catalina/manager/HTMLManagerServlet.java index fe0f7ece24..3c2b228346 100644 --- a/java/org/apache/catalina/manager/HTMLManagerServlet.java +++ b/java/org/apache/catalina/manager/HTMLManagerServlet.java @@ -270,6 +270,7 @@ public class HTMLManagerServlet extends ManagerServlet { * @param cn Name of the application to be deployed * @param war URL of the web application archive to be deployed * @param smClient internationalized strings + * * @return message String */ protected String deployInternal(String config, ContextName cn, String war, StringManager smClient) { @@ -290,6 +291,7 @@ public class HTMLManagerServlet extends ManagerServlet { * @param response The response * @param message a message to display * @param smClient internationalized strings + * * @throws IOException an IO error occurred */ protected void list(HttpServletRequest request, HttpServletResponse response, String message, @@ -568,7 +570,9 @@ public class HTMLManagerServlet extends ManagerServlet { * * @param cn Name of the application to be restarted * @param smClient StringManager for the client's locale + * * @return message String + * * @see ManagerServlet#reload(PrintWriter, ContextName, StringManager) */ protected String reload(ContextName cn, StringManager smClient) { @@ -586,7 +590,9 @@ public class HTMLManagerServlet extends ManagerServlet { * * @param cn Name of the application to be undeployed * @param smClient StringManager for the client's locale + * * @return message String + * * @see ManagerServlet#undeploy(PrintWriter, ContextName, StringManager) */ protected String undeploy(ContextName cn, StringManager smClient) { @@ -605,7 +611,9 @@ public class HTMLManagerServlet extends ManagerServlet { * @param cn Name of the application to list session information * @param idle Expire all sessions with idle time ≥ idle for this context * @param smClient StringManager for the client's locale + * * @return message String + * * @see ManagerServlet#sessions(PrintWriter, ContextName, int, StringManager) */ protected String sessions(ContextName cn, int idle, StringManager smClient) { @@ -623,7 +631,9 @@ public class HTMLManagerServlet extends ManagerServlet { * * @param cn Name of the application to be started * @param smClient StringManager for the client's locale + * * @return message String + * * @see ManagerServlet#start(PrintWriter, ContextName, StringManager) */ protected String start(ContextName cn, StringManager smClient) { @@ -641,7 +651,9 @@ public class HTMLManagerServlet extends ManagerServlet { * * @param cn Name of the application to be stopped * @param smClient StringManager for the client's locale + * * @return message String + * * @see ManagerServlet#stop(PrintWriter, ContextName, StringManager) */ protected String stop(ContextName cn, StringManager smClient) { @@ -658,7 +670,9 @@ public class HTMLManagerServlet extends ManagerServlet { * Find potential memory leaks caused by web application reload. * * @param smClient StringManager for the client's locale + * * @return message String + * * @see ManagerServlet#findleaks(boolean, PrintWriter, StringManager) */ protected String findleaks(StringManager smClient) { @@ -740,6 +754,7 @@ public class HTMLManagerServlet extends ManagerServlet { * @param cn Name of the application from which to expire sessions * @param req The Servlet request * @param smClient StringManager for the client's locale + * * @return message string */ protected String expireSessions(ContextName cn, HttpServletRequest req, StringManager smClient) { @@ -762,6 +777,7 @@ public class HTMLManagerServlet extends ManagerServlet { * @param req The Servlet request * @param resp The Servlet response * @param smClient StringManager for the client's locale + * * @throws ServletException Propagated Servlet error * @throws IOException An IO error occurred */ @@ -847,6 +863,7 @@ public class HTMLManagerServlet extends ManagerServlet { * @param req The Servlet request * @param resp The Servlet response * @param smClient StringManager for the client's locale + * * @throws ServletException Propagated Servlet error * @throws IOException An IO error occurred */ @@ -896,6 +913,7 @@ public class HTMLManagerServlet extends ManagerServlet { * @param cn Name of the application for which the sessions will be listed * @param sessionId the session id * @param smClient StringManager for the client's locale + * * @throws ServletException Propagated Servlet error * @throws IOException An IO error occurred */ @@ -918,6 +936,7 @@ public class HTMLManagerServlet extends ManagerServlet { * @param cn Name of the application for which sessions are to be invalidated * @param sessionIds the session ids of the sessions * @param smClient StringManager for the client's locale + * * @return number of invalidated sessions */ protected int invalidateSessions(ContextName cn, String[] sessionIds, StringManager smClient) { @@ -956,6 +975,7 @@ public class HTMLManagerServlet extends ManagerServlet { * @param sessionId the session id * @param attributeName the attribute name * @param smClient StringManager for the client's locale + * * @return true if there was an attribute removed, false otherwise */ protected boolean removeSessionAttribute(ContextName cn, String sessionId, String attributeName, diff --git a/java/org/apache/catalina/manager/ManagerServlet.java b/java/org/apache/catalina/manager/ManagerServlet.java index 9d0cfc8d25..de351a8b52 100644 --- a/java/org/apache/catalina/manager/ManagerServlet.java +++ b/java/org/apache/catalina/manager/ManagerServlet.java @@ -373,8 +373,7 @@ public class ManagerServlet extends HttpServlet implements ContainerServlet { } String config = request.getParameter("config"); String tag = request.getParameter("tag"); - boolean update = request.getParameter("update") != null - && request.getParameter("update").equals("true"); + boolean update = request.getParameter("update") != null && request.getParameter("update").equals("true"); // Prepare our output writer to generate the response message response.setContentType("text/plain;charset=" + Constants.CHARSET); @@ -735,7 +734,8 @@ public class ManagerServlet extends HttpServlet implements ContainerServlet { return; } if (!ExpandWar.copy(new File(config), new File(configBase, baseName + ".xml"))) { - writer.println(smClient.getString("managerServlet.copyFail", new File(config), new File(configBase, baseName + ".xml"))); + writer.println(smClient.getString("managerServlet.copyFail", new File(config), + new File(configBase, baseName + ".xml"))); return; } } @@ -909,7 +909,8 @@ public class ManagerServlet extends HttpServlet implements ContainerServlet { return; } if (!ExpandWar.copy(configFile, localConfigFile)) { - writer.println(smClient.getString("managerServlet.copyFail", configFile, localConfigFile)); + writer.println( + smClient.getString("managerServlet.copyFail", configFile, localConfigFile)); return; } } diff --git a/java/org/apache/catalina/mbeans/MBeanUtils.java b/java/org/apache/catalina/mbeans/MBeanUtils.java index 04af80a2d3..e9d2b5a450 100644 --- a/java/org/apache/catalina/mbeans/MBeanUtils.java +++ b/java/org/apache/catalina/mbeans/MBeanUtils.java @@ -450,7 +450,7 @@ public class MBeanUtils { static ObjectName createObjectName(String domain, Group group) throws MalformedObjectNameException { return new ObjectName(domain + ":type=Group,groupname=" + ObjectName.quote(group.getGroupname()) + - ",database=" + group.getUserDatabase().getId()); + ",database=" + group.getUserDatabase().getId()); } @@ -467,8 +467,8 @@ public class MBeanUtils { */ static ObjectName createObjectName(String domain, Role role) throws MalformedObjectNameException { - return new ObjectName(domain + ":type=Role,rolename=" + ObjectName.quote(role.getRolename()) + - ",database=" + role.getUserDatabase().getId()); + return new ObjectName(domain + ":type=Role,rolename=" + ObjectName.quote(role.getRolename()) + ",database=" + + role.getUserDatabase().getId()); } @@ -485,8 +485,8 @@ public class MBeanUtils { */ static ObjectName createObjectName(String domain, User user) throws MalformedObjectNameException { - return new ObjectName(domain + ":type=User,username=" + ObjectName.quote(user.getUsername()) + - ",database=" + user.getUserDatabase().getId()); + return new ObjectName(domain + ":type=User,username=" + ObjectName.quote(user.getUsername()) + ",database=" + + user.getUserDatabase().getId()); } diff --git a/java/org/apache/catalina/realm/JNDIRealm.java b/java/org/apache/catalina/realm/JNDIRealm.java index bda4a63195..d30f3026a5 100644 --- a/java/org/apache/catalina/realm/JNDIRealm.java +++ b/java/org/apache/catalina/realm/JNDIRealm.java @@ -1156,9 +1156,9 @@ 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 - * 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. + * 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. */ /* @@ -1832,7 +1832,7 @@ public class JNDIRealm extends RealmBase { } boolean validated = false; - Hashtable<?, ?> preservedEnvironment = context.getEnvironment(); + Hashtable<?,?> preservedEnvironment = context.getEnvironment(); // Elicit an LDAP bind operation using the provided user credentials try { @@ -2765,8 +2765,8 @@ public class JNDIRealm extends RealmBase { /** * Given a string containing LDAP patterns for user locations (separated by parentheses in a pseudo-LDAP search - * string format - "(location1)(location2)"), returns an array of those paths. Real LDAP search strings are supported - * as well (though only the "|" "OR" type). + * string format - "(location1)(location2)"), returns an array of those paths. Real LDAP search strings are + * supported as well (though only the "|" "OR" type). * * @param userPatternString - a string LDAP search paths surrounded by parentheses * diff --git a/java/org/apache/catalina/realm/LockOutRealm.java b/java/org/apache/catalina/realm/LockOutRealm.java index 22bc177570..3a3b0f5514 100644 --- a/java/org/apache/catalina/realm/LockOutRealm.java +++ b/java/org/apache/catalina/realm/LockOutRealm.java @@ -218,7 +218,7 @@ public class LockOutRealm extends CombinedRealm { // Check to see if user is locked // Otherwise, user has not, yet, exceeded lock thresholds return lockRecord.getFailures() >= failureCount && - (System.currentTimeMillis() - lockRecord.getLastFailureTime()) / 1000 < lockOutTime; + (System.currentTimeMillis() - lockRecord.getLastFailureTime()) / 1000 < lockOutTime; } diff --git a/java/org/apache/catalina/realm/NullRealm.java b/java/org/apache/catalina/realm/NullRealm.java index cc133a4b8a..57157c81a1 100644 --- a/java/org/apache/catalina/realm/NullRealm.java +++ b/java/org/apache/catalina/realm/NullRealm.java @@ -19,8 +19,8 @@ package org.apache.catalina.realm; import java.security.Principal; /** - * Minimal Realm implementation that always returns null when an attempt is made to validate a username and password. - * It is intended to be used as a default Realm implementation when no other Realm is specified. + * Minimal Realm implementation that always returns null when an attempt is made to validate a username and password. It + * is intended to be used as a default Realm implementation when no other Realm is specified. */ public class NullRealm extends RealmBase { diff --git a/java/org/apache/catalina/realm/UserDatabaseRealm.java b/java/org/apache/catalina/realm/UserDatabaseRealm.java index 0760f8f5a5..0b85e12eb6 100644 --- a/java/org/apache/catalina/realm/UserDatabaseRealm.java +++ b/java/org/apache/catalina/realm/UserDatabaseRealm.java @@ -112,8 +112,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 global JNDI context will be - * used + * @return {@code true} if a local JNDI context will be used, {@code false} if the global JNDI context will be used */ public boolean getLocalJndiResource() { return localJndiResource; diff --git a/java/org/apache/catalina/security/SecurityListener.java b/java/org/apache/catalina/security/SecurityListener.java index 0d0697a70a..5e6eb552db 100644 --- a/java/org/apache/catalina/security/SecurityListener.java +++ b/java/org/apache/catalina/security/SecurityListener.java @@ -221,8 +221,7 @@ public class SecurityListener implements LifecycleListener { if (allowedAgeDays >= 0) { String buildDateString = ServerInfo.getServerBuiltISO(); - if (null == buildDateString || buildDateString.isEmpty() || - !Character.isDigit(buildDateString.charAt(0))) { + if (null == buildDateString || buildDateString.isEmpty() || !Character.isDigit(buildDateString.charAt(0))) { log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); } else { try { diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java b/java/org/apache/catalina/servlets/DefaultServlet.java index 24052f9ceb..545ad0adc2 100644 --- a/java/org/apache/catalina/servlets/DefaultServlet.java +++ b/java/org/apache/catalina/servlets/DefaultServlet.java @@ -687,8 +687,8 @@ public class DefaultServlet extends HttpServlet { } } else { try { - resp.sendError(resourceInputStream != null ? - HttpServletResponse.SC_CONFLICT : HttpServletResponse.SC_BAD_REQUEST); + resp.sendError(resourceInputStream != null ? HttpServletResponse.SC_CONFLICT : + HttpServletResponse.SC_BAD_REQUEST); } catch (IllegalStateException e) { // Already committed, ignore } @@ -1226,7 +1226,7 @@ public class DefaultServlet extends HttpServlet { try { response.setBufferSize(output); } catch (IllegalStateException ignore) { - // Content has already been written - this must be an include. Ignore the error and continue. + // Content has already been written - this must be an include. Ignore the error and continue. } if (ostream != null) { if (!checkSendfile(request, response, resource, contentLength, range)) { @@ -2511,8 +2511,7 @@ public class DefaultServlet extends HttpServlet { if (headerValue.length() > 2 && (headerValue.charAt(0) == '"' || headerValue.charAt(2) == '"')) { boolean weakETag = headerValue.startsWith("W/\""); - if ((!weakETag && headerValue.charAt(0) != '"') || - headerValue.charAt(headerValue.length() - 1) != '"' || + if ((!weakETag && headerValue.charAt(0) != '"') || headerValue.charAt(headerValue.length() - 1) != '"' || headerValue.indexOf('"', weakETag ? 3 : 1) != headerValue.length() - 1) { // Not a single entity tag response.sendError(HttpServletResponse.SC_BAD_REQUEST); diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java b/java/org/apache/catalina/servlets/WebdavServlet.java index b3e12ea802..19a39946cf 100644 --- a/java/org/apache/catalina/servlets/WebdavServlet.java +++ b/java/org/apache/catalina/servlets/WebdavServlet.java @@ -1851,7 +1851,7 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen if (!allowSpecialPaths) { String upperCasePath = path.toUpperCase(Locale.ENGLISH); return upperCasePath.startsWith("/WEB-INF/") || upperCasePath.startsWith("/META-INF/") || - upperCasePath.equals("/WEB-INF") || upperCasePath.equals("/META-INF"); + upperCasePath.equals("/WEB-INF") || upperCasePath.equals("/META-INF"); } return false; } @@ -1979,7 +1979,7 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen if (parentPath == path || parentLock.depth > 0) { if (parentLock.isExclusive()) { return !ifHeader.contains(":" + parentLock.token + ">") || - (parentLock.principal != null && !parentLock.principal.equals(principal)); + (parentLock.principal != null && !parentLock.principal.equals(principal)); } else { for (String token : parentLock.sharedTokens) { LockInfo lock = sharedLocks.get(token); @@ -2756,8 +2756,8 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen private static boolean propertyEquals(Node node1, Node node2) { return node1.getLocalName().equals(node2.getLocalName()) && - ((node1.getNamespaceURI() == null && node2.getNamespaceURI() == null) || - (node1.getNamespaceURI() != null && node1.getNamespaceURI().equals(node2.getNamespaceURI()))); + ((node1.getNamespaceURI() == null && node2.getNamespaceURI() == null) || + (node1.getNamespaceURI() != null && node1.getNamespaceURI().equals(node2.getNamespaceURI()))); } diff --git a/java/org/apache/catalina/ssi/SSIServletExternalResolver.java b/java/org/apache/catalina/ssi/SSIServletExternalResolver.java index 668e31f5dd..b310891ba7 100644 --- a/java/org/apache/catalina/ssi/SSIServletExternalResolver.java +++ b/java/org/apache/catalina/ssi/SSIServletExternalResolver.java @@ -308,8 +308,8 @@ public class SSIServletExternalResolver implements SSIExternalResolver { } else if (nameParts[1].equals("PROTOCOL")) { retVal = req.getProtocol(); } else if (nameParts[1].equals("SOFTWARE")) { - retVal = context.getServerInfo() + ' ' + System.getProperty("java.vm.name") + - '/' + System.getProperty("java.vm.version") + ' ' + System.getProperty("os.name"); + retVal = context.getServerInfo() + ' ' + System.getProperty("java.vm.name") + '/' + + System.getProperty("java.vm.version") + ' ' + System.getProperty("os.name"); } } else if (name.equalsIgnoreCase("UNIQUE_ID")) { retVal = req.getRequestedSessionId(); diff --git a/java/org/apache/catalina/startup/CatalinaProperties.java b/java/org/apache/catalina/startup/CatalinaProperties.java index 64b480d18a..c74e8216bf 100644 --- a/java/org/apache/catalina/startup/CatalinaProperties.java +++ b/java/org/apache/catalina/startup/CatalinaProperties.java @@ -102,7 +102,7 @@ public class CatalinaProperties { properties.load(is); } catch (Throwable t) { handleThrowable(t); - log.warn(t.getMessage(),t); + log.warn(t.getMessage(), t); } finally { try { is.close(); diff --git a/java/org/apache/catalina/storeconfig/LoaderSF.java b/java/org/apache/catalina/storeconfig/LoaderSF.java index 8bae04ea48..c3129f3a03 100644 --- a/java/org/apache/catalina/storeconfig/LoaderSF.java +++ b/java/org/apache/catalina/storeconfig/LoaderSF.java @@ -63,6 +63,6 @@ public class LoaderSF extends StoreFactoryBase { } WebappLoader wloader = (WebappLoader) loader; return (!wloader.getDelegate()) && - wloader.getLoaderClass().equals("org.apache.catalina.loader.WebappClassLoader"); + wloader.getLoaderClass().equals("org.apache.catalina.loader.WebappClassLoader"); } } diff --git a/java/org/apache/catalina/storeconfig/StoreAppender.java b/java/org/apache/catalina/storeconfig/StoreAppender.java index dcbcbf8cc8..3ea95affa9 100644 --- a/java/org/apache/catalina/storeconfig/StoreAppender.java +++ b/java/org/apache/catalina/storeconfig/StoreAppender.java @@ -35,9 +35,9 @@ public class StoreAppender { /** * The set of classes that represent persistable properties. */ - private static final Class<?>[] persistables = { String.class, Integer.class, Integer.TYPE, Boolean.class, Boolean.TYPE, - Byte.class, Byte.TYPE, Character.class, Character.TYPE, Double.class, Double.TYPE, Float.class, Float.TYPE, - Long.class, Long.TYPE, Short.class, Short.TYPE, InetAddress.class }; + private static final Class<?>[] persistables = { String.class, Integer.class, Integer.TYPE, Boolean.class, + Boolean.TYPE, Byte.class, Byte.TYPE, Character.class, Character.TYPE, Double.class, Double.TYPE, + Float.class, Float.TYPE, Long.class, Long.TYPE, Short.class, Short.TYPE, InetAddress.class }; private int pos = 0; diff --git a/java/org/apache/catalina/tribes/ChannelInterceptor.java b/java/org/apache/catalina/tribes/ChannelInterceptor.java index 42b79f5ebe..5bc5544f95 100644 --- a/java/org/apache/catalina/tribes/ChannelInterceptor.java +++ b/java/org/apache/catalina/tribes/ChannelInterceptor.java @@ -182,8 +182,8 @@ public interface ChannelInterceptor extends MembershipListener, Heartbeat { void start(int svc) throws ChannelException; /** - * Shuts down the channel. This can be called multiple times for individual services to shut down. - * The svc parameter can be the logical or value of any constants + * Shuts down the channel. This can be called multiple times for individual services to shut down. The svc parameter + * can be the logical or value of any constants * * @param svc one of: * <ul> diff --git a/java/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java b/java/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java index 8e2fe1b671..727aaa4093 100644 --- a/java/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java +++ b/java/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java @@ -266,8 +266,8 @@ public class NonBlockingCoordinator extends ChannelInterceptorBase { Arrays.fill(m, others); Member[] mbrs = m.getMembers(); m.reset(); - return new CoordinationMessage(leader, local, mbrs, - new UniqueId(UUIDGenerator.randomUUID(true)), COORD_REQUEST); + return new CoordinationMessage(leader, local, mbrs, new UniqueId(UUIDGenerator.randomUUID(true)), + COORD_REQUEST); } protected void sendElectionMsg(Member local, Member next, CoordinationMessage msg) throws ChannelException { diff --git a/java/org/apache/catalina/tribes/io/ChannelData.java b/java/org/apache/catalina/tribes/io/ChannelData.java index 5c27170cda..154a4b5130 100644 --- a/java/org/apache/catalina/tribes/io/ChannelData.java +++ b/java/org/apache/catalina/tribes/io/ChannelData.java @@ -337,9 +337,7 @@ public class ChannelData implements ChannelMessage { @Override public String toString() { - return "ClusterData[src=" + - getAddress() + "; id=" + - bToS(getUniqueId()) + "; sent=" + + return "ClusterData[src=" + getAddress() + "; id=" + bToS(getUniqueId()) + "; sent=" + new Timestamp(this.getTimestamp()).toString() + ']'; } diff --git a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java index 4a41940214..e25882c7b7 100644 --- a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java +++ b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java @@ -373,8 +373,8 @@ public class McastServiceImpl extends MembershipProviderBase { } } catch (SocketTimeoutException ignore) { /* - * Do nothing. This is normal. We don't want to block forever since the receive thread is the same thread - * that does membership expiration. + * Do nothing. This is normal. We don't want to block forever since the receive thread is the same thread + * that does membership expiration. */ } checkExpired(); diff --git a/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java b/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java index 3e0ec7369a..72e52359f9 100644 --- a/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java +++ b/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java @@ -374,8 +374,8 @@ public class StaticMembershipProvider extends MembershipProviderBase @Override public String toString() { - return "MemberMessage[" + "name=" + new String(membershipId) + "; type=" + - getTypeDesc() + "; member=" + member + ']'; + return "MemberMessage[" + "name=" + new String(membershipId) + "; type=" + getTypeDesc() + "; member=" + + member + ']'; } protected String getTypeDesc() { diff --git a/java/org/apache/catalina/tribes/membership/cloud/KubernetesMembershipProvider.java b/java/org/apache/catalina/tribes/membership/cloud/KubernetesMembershipProvider.java index 66b36737bb..c8fac1d531 100644 --- a/java/org/apache/catalina/tribes/membership/cloud/KubernetesMembershipProvider.java +++ b/java/org/apache/catalina/tribes/membership/cloud/KubernetesMembershipProvider.java @@ -179,7 +179,7 @@ public class KubernetesMembershipProvider extends CloudMembershipProvider { // Use != to protect against clock issues if (!saTokenLastModifiedTime.equals(oldSaTokenLastModifiedTime)) { byte[] bytes = Files.readAllBytes(saTokenPath); - ((TokenStreamProvider)streamProvider).setToken(new String(bytes, StandardCharsets.US_ASCII)); + ((TokenStreamProvider) streamProvider).setToken(new String(bytes, StandardCharsets.US_ASCII)); } } catch (IOException ioe) { log.error(sm.getString("kubernetesMembershipProvider.streamError"), ioe); diff --git a/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java b/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java index 90ba24a1bf..fe8e02caf2 100644 --- a/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java +++ b/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java @@ -170,7 +170,7 @@ public abstract class AbstractReplicatedMap<K, V> * @param terminate - Flag for whether to terminate this map that failed to start. */ public AbstractReplicatedMap(MapOwner owner, Channel channel, long timeout, String mapContextName, - int initialCapacity, float loadFactor, int channelSendOptions, ClassLoader[] cls, boolean terminate) { + int initialCapacity, float loadFactor, int channelSendOptions, ClassLoader[] cls, boolean terminate) { innerMap = new ConcurrentHashMap<>(initialCapacity, loadFactor, 15); init(owner, channel, mapContextName, timeout, channelSendOptions, cls, terminate); @@ -204,7 +204,7 @@ public abstract class AbstractReplicatedMap<K, V> * @param terminate - Flag for whether to terminate this map that failed to start. */ protected void init(MapOwner owner, Channel channel, String mapContextName, long timeout, int channelSendOptions, - ClassLoader[] cls, boolean terminate) { + ClassLoader[] cls, boolean terminate) { long start = System.currentTimeMillis(); if (log.isInfoEnabled()) { log.info(sm.getString("abstractReplicatedMap.init.start", mapContextName)); @@ -1261,7 +1261,7 @@ public abstract class AbstractReplicatedMap<K, V> int counter = 0; for (Entry<K,?> e : innerMap.entrySet()) { if (e != null) { - MapEntry<K, V> entry = innerMap.get(e.getKey()); + MapEntry<K,V> entry = innerMap.get(e.getKey()); if (entry != null && entry.isActive() && entry.getValue() != null) { counter++; } @@ -1435,11 +1435,8 @@ public abstract class AbstractReplicatedMap<K, V> @Override public String toString() { - return "MapEntry[key:" + getKey() + "; " + - "value:" + getValue() + "; " + - "primary:" + isPrimary() + "; " + - "backup:" + isBackup() + "; " + - "proxy:" + isProxy() + ";]"; + return "MapEntry[key:" + getKey() + "; " + "value:" + getValue() + "; " + "primary:" + isPrimary() + "; " + + "backup:" + isBackup() + "; " + "proxy:" + isProxy() + ";]"; } } @@ -1477,8 +1474,8 @@ public abstract class AbstractReplicatedMap<K, V> @Override public String toString() { - return "MapMessage[context=" + new String(mapId) + "; type=" + getTypeDesc() + - "; key=" + key + "; value=" + value + ']'; + return "MapMessage[context=" + new String(mapId) + "; type=" + getTypeDesc() + "; key=" + key + "; value=" + + value + ']'; } public String getTypeDesc() { @@ -1515,7 +1512,7 @@ public abstract class AbstractReplicatedMap<K, V> } public MapMessage(byte[] mapId, int msgtype, boolean diff, Serializable key, Serializable value, - byte[] diffvalue, Member primary, Member[] nodes) { + byte[] diffvalue, Member primary, Member[] nodes) { this.mapId = mapId; this.msgtype = msgtype; this.diff = diff; diff --git a/java/org/apache/catalina/users/MemoryUserDatabase.java b/java/org/apache/catalina/users/MemoryUserDatabase.java index aeac16c648..da7369163e 100644 --- a/java/org/apache/catalina/users/MemoryUserDatabase.java +++ b/java/org/apache/catalina/users/MemoryUserDatabase.java @@ -652,8 +652,8 @@ public class MemoryUserDatabase implements UserDatabase { @Override public String toString() { - return "MemoryUserDatabase[id=" + this.id + ",pathname=" + pathname + ",groupCount=" + - this.groups.size() + ",roleCount=" + this.roles.size() + ",userCount=" + this.users.size() + ']'; + return "MemoryUserDatabase[id=" + this.id + ",pathname=" + pathname + ",groupCount=" + this.groups.size() + + ",roleCount=" + this.roles.size() + ",userCount=" + this.users.size() + ']'; } } diff --git a/java/org/apache/catalina/util/Introspection.java b/java/org/apache/catalina/util/Introspection.java index 835bfc5744..518af4b8be 100644 --- a/java/org/apache/catalina/util/Introspection.java +++ b/java/org/apache/catalina/util/Introspection.java @@ -60,7 +60,7 @@ public class Introspection { */ public static boolean isValidSetter(Method method) { return method.getName().startsWith("set") && method.getName().length() > 3 && - method.getParameterTypes().length == 1 && method.getReturnType().getName().equals("void"); + method.getParameterTypes().length == 1 && method.getReturnType().getName().equals("void"); } /** diff --git a/java/org/apache/catalina/util/LifecycleBase.java b/java/org/apache/catalina/util/LifecycleBase.java index fff576010c..9bdcaf8d63 100644 --- a/java/org/apache/catalina/util/LifecycleBase.java +++ b/java/org/apache/catalina/util/LifecycleBase.java @@ -184,8 +184,8 @@ public abstract class LifecycleBase implements Lifecycle { /** * Subclasses must ensure that the state is changed to {@link LifecycleState#STARTING} during the execution of this * method. Changing state will trigger the {@link Lifecycle#START_EVENT} event. If a component fails to start it may - * either throw a {@link LifecycleException} which will cause it's parent to fail to start, or it can place itself in - * the error state in which case {@link #stop()} will be called on the failed component but the parent component + * either throw a {@link LifecycleException} which will cause it's parent to fail to start, or it can place itself + * in the error state in which case {@link #stop()} will be called on the failed component but the parent component * will continue to start normally. * * @throws LifecycleException Start error occurred diff --git a/java/org/apache/catalina/util/RateLimiterBase.java b/java/org/apache/catalina/util/RateLimiterBase.java index 188eed88cf..016624e08f 100644 --- a/java/org/apache/catalina/util/RateLimiterBase.java +++ b/java/org/apache/catalina/util/RateLimiterBase.java @@ -48,8 +48,8 @@ public abstract class RateLimiterBase implements RateLimiter { private ScheduledThreadPoolExecutor internalExecutorService = null; /** - * If policy name has not been specified, the first call of {@link #getPolicyName()} returns an auto-generated policy - * name using the default policy name as prefix and followed by auto-increase index. + * If policy name has not been specified, the first call of {@link #getPolicyName()} returns an auto-generated + * policy name using the default policy name as prefix and followed by auto-increase index. * * @return default policy name, as a prefix of auto-generated policy name. */ diff --git a/java/org/apache/catalina/util/TimeBucketCounterBase.java b/java/org/apache/catalina/util/TimeBucketCounterBase.java index f5e1c318c2..0251054bce 100644 --- a/java/org/apache/catalina/util/TimeBucketCounterBase.java +++ b/java/org/apache/catalina/util/TimeBucketCounterBase.java @@ -182,9 +182,9 @@ public abstract class TimeBucketCounterBase { */ public void periodicEvict() { /* - * The implementation of this method assumes that the time taken for eviction is less than 1 bucket duration. - * It is possible that the eviction process starts in one bucket but finishes in another. Therefore, keys for - * the current bucket and the next bucket when the eviction process starts are excluded from eviction. + * The implementation of this method assumes that the time taken for eviction is less than 1 bucket duration. It + * is possible that the eviction process starts in one bucket but finishes in another. Therefore, keys for the + * current bucket and the next bucket when the eviction process starts are excluded from eviction. */ long currentBucketIndex = getCurrentBucketPrefix(); String currentBucketPrefix = String.valueOf(currentBucketIndex); diff --git a/java/org/apache/catalina/util/XMLWriter.java b/java/org/apache/catalina/util/XMLWriter.java index 24f8c0a7ce..d4ec9302bd 100644 --- a/java/org/apache/catalina/util/XMLWriter.java +++ b/java/org/apache/catalina/util/XMLWriter.java @@ -141,7 +141,7 @@ public class XMLWriter { } if (namespaceInfo != null) { buffer.append("<").append(namespace).append(":").append(name).append(" xmlns:") - .append(namespace).append("=\"").append(namespaceInfo).append("\">"); + .append(namespace).append("=\"").append(namespaceInfo).append("\">"); } else { buffer.append("<").append(namespace).append(":").append(name).append(">"); } @@ -158,7 +158,7 @@ public class XMLWriter { } if (namespaceInfo != null) { buffer.append("<").append(namespace).append(":").append(name).append(" xmlns:") - .append(namespace).append("=\"").append(namespaceInfo).append("\"/>\n"); + .append(namespace).append("=\"").append(namespaceInfo).append("\"/>\n"); } else { buffer.append("<").append(namespace).append(":").append(name).append("/>\n"); } diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java b/java/org/apache/catalina/valves/AbstractAccessLogValve.java index 9a1907e55e..4b58d60bd5 100644 --- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java +++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java @@ -1679,7 +1679,6 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access } - /** * Write identifier element %{xxx}L */ @@ -1709,7 +1708,7 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access @Override public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) { - switch(identifierType) { + switch (identifierType) { case CONNECTION: buf.append(request.getServletConnection().getConnectionId()); break; diff --git a/java/org/apache/catalina/valves/ErrorReportValve.java b/java/org/apache/catalina/valves/ErrorReportValve.java index ec231fa594..9f453cdf50 100644 --- a/java/org/apache/catalina/valves/ErrorReportValve.java +++ b/java/org/apache/catalina/valves/ErrorReportValve.java @@ -389,8 +389,7 @@ public class ErrorReportValve extends ValveBase { response.setContentType("text/html"); response.setCharacterEncoding("UTF-8"); - try (OutputStream os = response.getOutputStream(); - InputStream is = new FileInputStream(file)) { + try (OutputStream os = response.getOutputStream(); InputStream is = new FileInputStream(file)) { IOTools.flow(is, os); } catch (IOException ioe) { getContainer().getLogger().warn(sm.getString("errorReportValve.errorPageIOException", location), ioe); diff --git a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java index c4de4ff65e..aef45048a1 100644 --- a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java +++ b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java @@ -42,8 +42,8 @@ import org.apache.tomcat.util.ExceptionUtils; /** * An implementation of the W3c Extended Log File Format. See - * <a href="http://www.w3.org/TR/WD-logfile.html">WD-logfile-960323</a> - * for more information about the format. The following fields are supported: + * <a href="http://www.w3.org/TR/WD-logfile.html">WD-logfile-960323</a> for more information about the format. The + * following fields are supported: * <ul> * <li><code>c-dns</code>: Client hostname (or ip address if <code>enableLookups</code> for the connector is false)</li> * <li><code>c-ip</code>: Client ip address</li> @@ -97,7 +97,7 @@ public class ExtendedAccessLogValve extends AccessLogValve { * toString() fails, '-' will be written to the buffer. * * @param value - The value to wrap - * @param buf the buffer to write to + * @param buf the buffer to write to */ static void wrap(Object value, CharArrayWriter buf) { String svalue; diff --git a/java/org/apache/catalina/valves/JsonErrorReportValve.java b/java/org/apache/catalina/valves/JsonErrorReportValve.java index 84e402e90b..f68c338307 100644 --- a/java/org/apache/catalina/valves/JsonErrorReportValve.java +++ b/java/org/apache/catalina/valves/JsonErrorReportValve.java @@ -28,8 +28,8 @@ import org.apache.tomcat.util.json.JSONFilter; import org.apache.tomcat.util.res.StringManager; /** - * Implementation of a Valve that outputs error JSON. - * This Valve should be attached at the Host level, although it will work if attached to a Context. + * Implementation of a Valve that outputs error JSON. This Valve should be attached at the Host level, although it will + * work if attached to a Context. */ public class JsonErrorReportValve extends ErrorReportValve { @@ -112,7 +112,8 @@ public class JsonErrorReportValve extends ErrorReportValve { } for (int i = 0; i < pos; i++) { if (!(elements[i].getClassName().startsWith("org.apache.catalina.core."))) { - sb.append(',').append('\"').append(' ').append(JSONFilter.escape(elements[i].toString())).append('\"'); + sb.append(',').append('\"').append(' ').append(JSONFilter.escape(elements[i].toString())) + .append('\"'); } } diff --git a/java/org/apache/catalina/valves/ParameterLimitValve.java b/java/org/apache/catalina/valves/ParameterLimitValve.java index 820eb06eba..932512b74f 100644 --- a/java/org/apache/catalina/valves/ParameterLimitValve.java +++ b/java/org/apache/catalina/valves/ParameterLimitValve.java @@ -217,10 +217,10 @@ public class ParameterLimitValve extends ValveBase { Pattern pattern = Pattern.compile(UDecoder.URLDecode(patternString, StandardCharsets.UTF_8)); String[] limits = limitsString.split(","); if (limits.length == 1) { - urlPatternLimits.put(pattern, new Integer[] { Integer.valueOf(limits[0]), null, null}); + urlPatternLimits.put(pattern, new Integer[] { Integer.valueOf(limits[0]), null, null }); } else if (limits.length == 3) { - urlPatternLimits.put(pattern, new Integer[] { - Integer.valueOf(limits[0]), Integer.valueOf(limits[1]), Integer.valueOf(limits[2])}); + urlPatternLimits.put(pattern, new Integer[] { Integer.valueOf(limits[0]), + Integer.valueOf(limits[1]), Integer.valueOf(limits[2]) }); } else { throw new IllegalArgumentException( sm.getString("parameterLimitValve.invalidLimitsString", limitsString)); diff --git a/java/org/apache/catalina/valves/RemoteIpValve.java b/java/org/apache/catalina/valves/RemoteIpValve.java index 309f24d3b4..d0ed7684bf 100644 --- a/java/org/apache/catalina/valves/RemoteIpValve.java +++ b/java/org/apache/catalina/valves/RemoteIpValve.java @@ -397,14 +397,13 @@ public class RemoteIpValve extends ValveBase { /** * @see #setInternalProxies(String) */ - private Pattern internalProxies = - Pattern.compile("10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" + "192\\.168\\.\\d{1,3}\\.\\d{1,3}|" + - "169\\.254\\.\\d{1,3}\\.\\d{1,3}|" + "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" + - "100\\.6[4-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "100\\.[7-9]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" + - "100\\.1[0-1]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" + "100\\.12[0-7]{1}\\.\\d{1,3}\\.\\d{1,3}|" + - "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + - "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "0:0:0:0:0:0:0:1|::1|" + - "fe[89ab]\\p{XDigit}:.*|" + "f[cd]\\p{XDigit}{2}+:.*"); + private Pattern internalProxies = Pattern.compile("10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" + + "192\\.168\\.\\d{1,3}\\.\\d{1,3}|" + "169\\.254\\.\\d{1,3}\\.\\d{1,3}|" + + "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" + "100\\.6[4-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + + "100\\.[7-9]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" + "100\\.1[0-1]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" + + "100\\.12[0-7]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + + "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" + "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" + + "0:0:0:0:0:0:0:1|::1|" + "fe[89ab]\\p{XDigit}:.*|" + "f[cd]\\p{XDigit}{2}+:.*"); /** * @see #setProtocolHeader(String) diff --git a/java/org/apache/catalina/valves/rewrite/QuotedStringTokenizer.java b/java/org/apache/catalina/valves/rewrite/QuotedStringTokenizer.java index 176b89756f..9fe80bb9a3 100644 --- a/java/org/apache/catalina/valves/rewrite/QuotedStringTokenizer.java +++ b/java/org/apache/catalina/valves/rewrite/QuotedStringTokenizer.java @@ -79,7 +79,7 @@ public class QuotedStringTokenizer { break; default: throw new IllegalStateException(sm.getString("quotedStringTokenizer.tokenizeError", inputText, - Integer.valueOf(pos), currentMode)); + Integer.valueOf(pos), currentMode)); } pos++; } diff --git a/java/org/apache/catalina/valves/rewrite/RewriteValve.java b/java/org/apache/catalina/valves/rewrite/RewriteValve.java index fd428714fd..baf4129c6b 100644 --- a/java/org/apache/catalina/valves/rewrite/RewriteValve.java +++ b/java/org/apache/catalina/valves/rewrite/RewriteValve.java @@ -253,7 +253,7 @@ public class RewriteValve extends ValveBase { for (RewriteCond condition : conditions) { if (containerLog.isTraceEnabled()) { containerLog.trace("Add condition " + condition.getCondPattern() + " test " + - condition.getTestString() + " to rule with pattern " + rule.getPatternString() + + condition.getTestString() + " to rule with pattern " + rule.getPatternString() + " and substitution " + rule.getSubstitutionString() + (condition.isOrnext() ? " [OR]" : "") + (condition.isNocase() ? " [NC]" : "")); } @@ -537,7 +537,8 @@ public class RewriteValve extends ValveBase { urlStringRewriteEncoded = urlStringRewriteEncoded.substring(0, queryIndex); } // Parse path parameters from rewrite production and populate request path parameters - urlStringRewriteEncoded = org.apache.catalina.util.RequestUtil.stripPathParams(urlStringRewriteEncoded, request); + urlStringRewriteEncoded = + org.apache.catalina.util.RequestUtil.stripPathParams(urlStringRewriteEncoded, request); // Save the current context path before re-writing starts String contextPath = null; if (context) { diff --git a/java/org/apache/catalina/webresources/Cache.java b/java/org/apache/catalina/webresources/Cache.java index ae85288fe8..b76ccf7049 100644 --- a/java/org/apache/catalina/webresources/Cache.java +++ b/java/org/apache/catalina/webresources/Cache.java @@ -233,8 +233,9 @@ public class Cache { private boolean noCache(String path) { // Don't cache classes. The class loader handles this. // Don't cache JARs. The ResourceSet handles this. - return (path.endsWith(".class") && (path.startsWith("/WEB-INF/classes/") || path.startsWith("/WEB-INF/lib/"))) || - (path.startsWith("/WEB-INF/lib/") && path.endsWith(".jar")); + return (path.endsWith(".class") && + (path.startsWith("/WEB-INF/classes/") || path.startsWith("/WEB-INF/lib/"))) || + (path.startsWith("/WEB-INF/lib/") && path.endsWith(".jar")); } private long evict(long targetSize, Iterator<CachedResource> iter) { diff --git a/java/org/apache/coyote/CompressionConfig.java b/java/org/apache/coyote/CompressionConfig.java index 8366eca566..abe3a0dce6 100644 --- a/java/org/apache/coyote/CompressionConfig.java +++ b/java/org/apache/coyote/CompressionConfig.java @@ -215,9 +215,9 @@ public class CompressionConfig { if (tokens.contains("identity")) { // If identity, do not do content modifications useContentEncoding = false; - } else if (tokens.contains("br") || tokens.contains("compress") || tokens.contains("dcb") - || tokens.contains("dcz") || tokens.contains("deflate") || tokens.contains("gzip") - || tokens.contains("pack200-gzip") || tokens.contains("zstd")) { + } else if (tokens.contains("br") || tokens.contains("compress") || tokens.contains("dcb") || + tokens.contains("dcz") || tokens.contains("deflate") || tokens.contains("gzip") || + tokens.contains("pack200-gzip") || tokens.contains("zstd")) { // Content should not be compressed twice return false; } diff --git a/java/org/apache/coyote/Request.java b/java/org/apache/coyote/Request.java index 92275edca8..80dde650e1 100644 --- a/java/org/apache/coyote/Request.java +++ b/java/org/apache/coyote/Request.java @@ -72,8 +72,8 @@ public final class Request { * another 3,000,000 years before it gets back to zero). * * Local testing shows that 5, 10, 50, 500 or 1000 threads can obtain 60,000,000+ IDs a second from a single - * AtomicLong. That is about 17ns per request. It does not appear that the introduction of this counter will - * cause a bottleneck for request processing. + * AtomicLong. That is about 17ns per request. It does not appear that the introduction of this counter will cause a + * bottleneck for request processing. */ private static final AtomicLong requestIdGenerator = new AtomicLong(0); diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java b/java/org/apache/coyote/ajp/AjpProcessor.java index 9fe5cb86ca..50587c6a7e 100644 --- a/java/org/apache/coyote/ajp/AjpProcessor.java +++ b/java/org/apache/coyote/ajp/AjpProcessor.java @@ -1059,9 +1059,9 @@ public class AjpProcessor extends AbstractProcessor { refillReadBuffer(false); } catch (IOException ioe) { /* - * Probably a timeout. This approach isn't ideal but it works. Returning 1 will indicate that data is - * available which should trigger a read which in turn will trigger another IOException and that one - * can be thrown. + * Probably a timeout. This approach isn't ideal but it works. Returning 1 will indicate that data is + * available which should trigger a read which in turn will trigger another IOException and that one can + * be thrown. */ return 1; } diff --git a/java/org/apache/el/lang/ELSupport.java b/java/org/apache/el/lang/ELSupport.java index 7ae561555a..633894884c 100644 --- a/java/org/apache/el/lang/ELSupport.java +++ b/java/org/apache/el/lang/ELSupport.java @@ -190,8 +190,8 @@ public class ELSupport { } /* - * Going to have some casts /raw types somewhere so doing it here keeps them all in one place. There might - * be a neater / better solution, but I couldn't find it. + * Going to have some casts /raw types somewhere so doing it here keeps them all in one place. There might be a + * neater / better solution, but I couldn't find it. */ @SuppressWarnings("unchecked") public static Enum<?> coerceToEnum(final ELContext ctx, final Object obj, @@ -240,8 +240,7 @@ public class ELSupport { * * @throws ELException if object is not Boolean or String */ - public static Boolean coerceToBoolean(final ELContext ctx, final Object obj, boolean primitive) - throws ELException { + public static Boolean coerceToBoolean(final ELContext ctx, final Object obj, boolean primitive) throws ELException { if (ctx != null) { boolean originalIsPropertyResolved = ctx.isPropertyResolved(); @@ -349,8 +348,7 @@ public class ELSupport { throw new ELException(MessageFactory.get("error.convert", number, number.getClass(), type)); } - public static Number coerceToNumber(final ELContext ctx, final Object obj, final Class<?> type) - throws ELException { + public static Number coerceToNumber(final ELContext ctx, final Object obj, final Class<?> type) throws ELException { if (ctx != null) { boolean originalIsPropertyResolved = ctx.isPropertyResolved(); @@ -489,8 +487,7 @@ public class ELSupport { } } - public static <T> T coerceToType(final ELContext ctx, final Object obj, final Class<T> type) - throws ELException { + public static <T> T coerceToType(final ELContext ctx, final Object obj, final Class<T> type) throws ELException { if (ctx != null) { boolean originalIsPropertyResolved = ctx.isPropertyResolved(); diff --git a/java/org/apache/jasper/Options.java b/java/org/apache/jasper/Options.java index b0802f8e1c..fa34eecfb9 100644 --- a/java/org/apache/jasper/Options.java +++ b/java/org/apache/jasper/Options.java @@ -345,7 +345,7 @@ public interface Options { /** * A string containing a comma-separated list of names to which custom tag implementations should be applied. - * Unknown or unused tag entries are harmless. Generally defined via an init parameter on the JspServlet. + * Unknown or unused tag entries are harmless. Generally defined via an init parameter on the JspServlet. * * @return which tags to use */ diff --git a/java/org/apache/jasper/compiler/Compiler.java b/java/org/apache/jasper/compiler/Compiler.java index 94eab9d081..f046bf54da 100644 --- a/java/org/apache/jasper/compiler/Compiler.java +++ b/java/org/apache/jasper/compiler/Compiler.java @@ -427,8 +427,8 @@ public abstract class Compiler { if (jsw != null && (ctxt.getOptions().getModificationTestInterval() > 0)) { - if (jsw.getLastModificationTest() + - (ctxt.getOptions().getModificationTestInterval() * 1000L) > System.currentTimeMillis()) { + if (jsw.getLastModificationTest() + (ctxt.getOptions().getModificationTestInterval() * 1000L) > System + .currentTimeMillis()) { return false; } jsw.setLastModificationTest(System.currentTimeMillis()); diff --git a/java/org/apache/jasper/compiler/ELFunctionMapper.java b/java/org/apache/jasper/compiler/ELFunctionMapper.java index bc4fd2b86c..58ea2bf2b2 100644 --- a/java/org/apache/jasper/compiler/ELFunctionMapper.java +++ b/java/org/apache/jasper/compiler/ELFunctionMapper.java @@ -198,7 +198,8 @@ public class ELFunctionMapper { // Generate declaration for the map statically decName = getMapName(); - ss.append("private static org.apache.jasper.runtime.ProtectedFunctionMapper ").append(decName).append(";\n"); + ss.append("private static org.apache.jasper.runtime.ProtectedFunctionMapper ").append(decName) + .append(";\n"); ds.append(" ").append(decName).append("= "); ds.append("org.apache.jasper.runtime.ProtectedFunctionMapper"); diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java index c4114fe193..87a139fc01 100644 --- a/java/org/apache/jasper/compiler/Generator.java +++ b/java/org/apache/jasper/compiler/Generator.java @@ -1763,7 +1763,7 @@ class Generator { nvp = " + \" " + jspAttribute.getName() + "=\\\"\" + " + value + " + \"\\\"\""; } else { nvp = " + (java.lang.Boolean.valueOf(" + omit + ")?\"\":\" " + jspAttribute.getName() + - "=\\\"\" + " + value + " + \"\\\"\")"; + "=\\\"\" + " + value + " + \"\\\"\")"; } } else { value = attributeValue(jspAttribute, false, Object.class); @@ -3058,73 +3058,68 @@ class Generator { } /** - * Determines whether a tag should be handled via nonstandard code (typically - * faster). Considers both configuration and level of support within Tomcat. + * Determines whether a tag should be handled via nonstandard code (typically faster). Considers both + * configuration and level of support within Tomcat. * <p> - * Note that Tomcat is free to ignore any case it cannot handle, as long as it - * reports it accurately to the caller by returning false. For example, the - * initial implementation for c:set excludes support for body content. c:set - * tags with body content will be generated with the standard code and tags - * without body content will be generated via non-standard code. + * Note that Tomcat is free to ignore any case it cannot handle, as long as it reports it accurately to the + * caller by returning false. For example, the initial implementation for c:set excludes support for body + * content. c:set tags with body content will be generated with the standard code and tags without body content + * will be generated via non-standard code. * - * @param n tag + * @param n tag * @param jspAttributes jsp attributes + * * @return whether code was generated + * * @throws JasperException unexpected error */ - private boolean visitPotentiallyNonstandardCustomTag(Node.CustomTag n) - throws JasperException { + private boolean visitPotentiallyNonstandardCustomTag(Node.CustomTag n) throws JasperException { if (!nonstandardCustomTagNames.contains(n.getQName())) { // tag is not configured, move along return false; } // collect the attributes into one Map for further checks - Map<String, JspAttribute> jspAttributes = new HashMap<>(); + Map<String,JspAttribute> jspAttributes = new HashMap<>(); if (n.getJspAttributes() != null) { for (JspAttribute jspAttr : n.getJspAttributes()) { jspAttributes.put(jspAttr.getLocalName(), jspAttr); } } switch (n.qName) { - case "c:set": - // requires var and value, scope is optional, body is prohibited, value cannot be deferred - if (n.hasEmptyBody() - && jspAttributes.containsKey("var") - && jspAttributes.containsKey("value") - && CORE_LIBS_URI.equals(n.getURI())) { - // verify value is not a deferred expression - String valueText = jspAttributes.get("value").getValue(); - if (valueText.startsWith("#")) { - return false; - } else if (jspAttributes.size() == 2 - || (jspAttributes.size() == 3 && jspAttributes.containsKey("scope"))) { - generateNonstandardSetLogic(n, jspAttributes); - return true; + case "c:set": + // requires var and value, scope is optional, body is prohibited, value cannot be deferred + if (n.hasEmptyBody() && jspAttributes.containsKey("var") && jspAttributes.containsKey("value") && + CORE_LIBS_URI.equals(n.getURI())) { + // verify value is not a deferred expression + String valueText = jspAttributes.get("value").getValue(); + if (valueText.startsWith("#")) { + return false; + } else if (jspAttributes.size() == 2 || + (jspAttributes.size() == 3 && jspAttributes.containsKey("scope"))) { + generateNonstandardSetLogic(n, jspAttributes); + return true; + } } - } - break; - case "c:remove": - // requires var, scope is optional, body is prohibited - if (n.hasEmptyBody() - && jspAttributes.containsKey("var") - && CORE_LIBS_URI.equals(n.getURI()) - && (jspAttributes.size() == 1 - || (jspAttributes.size() == 2 - && jspAttributes.containsKey("scope")))) { - generateNonstandardRemoveLogic(n, jspAttributes); - return true; + break; + case "c:remove": + // requires var, scope is optional, body is prohibited + if (n.hasEmptyBody() && jspAttributes.containsKey("var") && CORE_LIBS_URI.equals(n.getURI()) && + (jspAttributes.size() == 1 || + (jspAttributes.size() == 2 && jspAttributes.containsKey("scope")))) { + generateNonstandardRemoveLogic(n, jspAttributes); + return true; - } - break; - default: - // This indicates someone configured a tag with no non-standard implementation. - // Harmless, fall back to the standard implementation. + } + break; + default: + // This indicates someone configured a tag with no non-standard implementation. + // Harmless, fall back to the standard implementation. } return false; } - private void generateNonstandardSetLogic(Node.CustomTag n, Map<String, JspAttribute> jspAttributes) + private void generateNonstandardSetLogic(Node.CustomTag n, Map<String,JspAttribute> jspAttributes) throws JasperException { String baseVar = createTagVarName(n.getQName(), n.getPrefix(), n.getLocalName()); String tagMethod = "_jspx_meth_" + baseVar; @@ -3153,13 +3148,13 @@ class Generator { JspAttribute varAttribute = jspAttributes.get("var"); Mark m = n.getStart(); - out.printil("// " + m.getFile() + "(" + m.getLineNumber() + "," + m.getColumnNumber() + ") " - + varAttribute.getTagAttributeInfo()); + out.printil("// " + m.getFile() + "(" + m.getLineNumber() + "," + m.getColumnNumber() + ") " + + varAttribute.getTagAttributeInfo()); JspAttribute valueAttribute = jspAttributes.get("value"); m = n.getStart(); - out.printil("// " + m.getFile() + "(" + m.getLineNumber() + "," + m.getColumnNumber() + ") " - + valueAttribute.getTagAttributeInfo()); + out.printil("// " + m.getFile() + "(" + m.getLineNumber() + "," + m.getColumnNumber() + ") " + + valueAttribute.getTagAttributeInfo()); String varValue = varAttribute.getValue(); @@ -3167,12 +3162,11 @@ class Generator { String scopeValue = translateScopeToConstant(jspAttributes); // translates the specified value attributes into EL-interpretation code using standard logic - String evaluatedAttribute = evaluateAttribute(getTagHandlerInfo(n), valueAttribute, - n, null); + String evaluatedAttribute = evaluateAttribute(getTagHandlerInfo(n), valueAttribute, n, null); // call the multi-line logic equivalent of SetTag - out.printil("org.apache.jasper.runtime.JspRuntimeLibrary.nonstandardSetTag(_jspx_page_context, \"" - + varValue + "\", " + evaluatedAttribute + ", " + scopeValue + ");"); + out.printil("org.apache.jasper.runtime.JspRuntimeLibrary.nonstandardSetTag(_jspx_page_context, \"" + + varValue + "\", " + evaluatedAttribute + ", " + scopeValue + ");"); // Generate end of method out.popIndent(); @@ -3186,46 +3180,49 @@ class Generator { /** * Compile-time translation of the scope variable into the constant equivalent. Avoids runtime evaluation as - * performed by SetTag. Unspecified scope means page. + * performed by SetTag. Unspecified scope means page. * * @param jspAttributes attributes + * * @return equivalent constant from PageContext */ - private String translateScopeToConstant(Map<String, JspAttribute> jspAttributes) { + private String translateScopeToConstant(Map<String,JspAttribute> jspAttributes) { String scopeValue; JspAttribute scopeAttribute = jspAttributes.get("scope"); if (scopeAttribute == null) { scopeValue = "jakarta.servlet.jsp.PageContext.PAGE_SCOPE"; } else { switch (scopeAttribute.getValue()) { - case "": - case "page": - scopeValue = "jakarta.servlet.jsp.PageContext.PAGE_SCOPE"; - break; - case "request": - scopeValue = "jakarta.servlet.jsp.PageContext.REQUEST_SCOPE"; - break; - case "session": - scopeValue = "jakarta.servlet.jsp.PageContext.SESSION_SCOPE"; - break; - case "application": - scopeValue = "jakarta.servlet.jsp.PageContext.APPLICATION_SCOPE"; - break; - default: - throw new IllegalArgumentException(Localizer.getMessage("jsp.error.page.invalid.scope")); + case "": + case "page": + scopeValue = "jakarta.servlet.jsp.PageContext.PAGE_SCOPE"; + break; + case "request": + scopeValue = "jakarta.servlet.jsp.PageContext.REQUEST_SCOPE"; + break; + case "session": + scopeValue = "jakarta.servlet.jsp.PageContext.SESSION_SCOPE"; + break; + case "application": + scopeValue = "jakarta.servlet.jsp.PageContext.APPLICATION_SCOPE"; + break; + default: + throw new IllegalArgumentException(Localizer.getMessage("jsp.error.page.invalid.scope")); } } return scopeValue; } /** - * Generates the code for a non-standard remove. Note that removes w/o a specified scope will remove from all scopes. + * Generates the code for a non-standard remove. Note that removes w/o a specified scope will remove from all + * scopes. * - * @param n tag + * @param n tag * @param jspAttributes attributes + * * @throws JasperException unspecified error */ - private void generateNonstandardRemoveLogic(Node.CustomTag n, Map<String, JspAttribute> jspAttributes) + private void generateNonstandardRemoveLogic(Node.CustomTag n, Map<String,JspAttribute> jspAttributes) throws JasperException { String baseVar = createTagVarName(n.getQName(), n.getPrefix(), n.getLocalName()); String tagMethod = "_jspx_meth_" + baseVar; diff --git a/java/org/apache/jasper/compiler/JavaCompiler.java b/java/org/apache/jasper/compiler/JavaCompiler.java index 2cc6d48c5c..451296d060 100644 --- a/java/org/apache/jasper/compiler/JavaCompiler.java +++ b/java/org/apache/jasper/compiler/JavaCompiler.java @@ -42,7 +42,7 @@ public class JavaCompiler extends Compiler { private final Log log = LogFactory.getLog(JavaCompiler.class); // must not be static @Override - protected void generateClass(Map<String, SmapStratum> smaps) throws JasperException, IOException { + protected void generateClass(Map<String,SmapStratum> smaps) throws JasperException, IOException { long t1 = 0; if (log.isDebugEnabled()) { @@ -51,14 +51,13 @@ public class JavaCompiler extends Compiler { javax.tools.JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>(); - StandardJavaFileManager fileManager = - compiler.getStandardFileManager(diagnostics, null, Charset.forName(ctxt.getOptions().getJavaEncoding())); + StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, + Charset.forName(ctxt.getOptions().getJavaEncoding())); Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromFiles(List.of(new File(ctxt.getServletJavaFileName()))); // Perform Java compilation using the appropriate options - List<String> compilerOptions = - List.of("-classpath", ctxt.getClassPath(), "-source", ctxt.getOptions().getCompilerSourceVM(), - "-target", ctxt.getOptions().getCompilerTargetVM()); + List<String> compilerOptions = List.of("-classpath", ctxt.getClassPath(), "-source", + ctxt.getOptions().getCompilerSourceVM(), "-target", ctxt.getOptions().getCompilerTargetVM()); Boolean result = compiler.getTask(null, fileManager, diagnostics, compilerOptions, null, compilationUnits).call(); diff --git a/java/org/apache/jasper/compiler/JspDocumentParser.java b/java/org/apache/jasper/compiler/JspDocumentParser.java index 4f17659771..6839c7ab56 100644 --- a/java/org/apache/jasper/compiler/JspDocumentParser.java +++ b/java/org/apache/jasper/compiler/JspDocumentParser.java @@ -364,8 +364,8 @@ class JspDocumentParser extends DefaultHandler2 implements TagConstants { * * The SAX does not call this method with all of the template text, but may invoke this method with chunks of it. * This is a problem when we try to determine if the text contains only whitespaces, or when we are looking for an - * EL expression string. Therefore, it is necessary to buffer and concatenate the chunks and process the concatenated - * text later (at beginTag and endTag) + * EL expression string. Therefore, it is necessary to buffer and concatenate the chunks and process the + * concatenated text later (at beginTag and endTag) * * @param buf The characters * diff --git a/java/org/apache/jasper/compiler/JspReader.java b/java/org/apache/jasper/compiler/JspReader.java index fefbaf3435..eceb7862fe 100644 --- a/java/org/apache/jasper/compiler/JspReader.java +++ b/java/org/apache/jasper/compiler/JspReader.java @@ -405,7 +405,8 @@ class JspReader { Boolean result; Mark restart = null; - skip: while ((result = indexOf(firstChar, ret)) != null) { + skip: + while ((result = indexOf(firstChar, ret)) != null) { if (result.booleanValue()) { if (restart != null) { restart.init(current, true); @@ -442,7 +443,8 @@ class JspReader { int ch; int prev = 'x'; // Doesn't matter char firstChar = limit.charAt(0); - skip: for (ch = nextChar(ret); ch != -1; prev = ch, ch = nextChar(ret)) { + skip: + for (ch = nextChar(ret); ch != -1; prev = ch, ch = nextChar(ret)) { if (ch == '\\' && prev == '\\') { ch = 0; // Double \ is not an escape char anymore } else if (prev == '\\') { diff --git a/java/org/apache/jasper/compiler/Node.java b/java/org/apache/jasper/compiler/Node.java index a3be4363e9..74d9c19131 100644 --- a/java/org/apache/jasper/compiler/Node.java +++ b/java/org/apache/jasper/compiler/Node.java @@ -346,8 +346,8 @@ public abstract class Node implements TagConstants { } /** - * Selects and invokes a method in the visitor class based on the node type. This is abstract and should be overridden - * by the extending classes. + * Selects and invokes a method in the visitor class based on the node type. This is abstract and should be + * overridden by the extending classes. * * @param v The visitor class */ diff --git a/java/org/apache/jasper/compiler/PageInfo.java b/java/org/apache/jasper/compiler/PageInfo.java index 7782a9e977..563931cba4 100644 --- a/java/org/apache/jasper/compiler/PageInfo.java +++ b/java/org/apache/jasper/compiler/PageInfo.java @@ -530,8 +530,7 @@ public class PageInfo { /* * isThreadSafe */ - public void setIsThreadSafe(String value, Node n, ErrorDispatcher err) - throws JasperException { + public void setIsThreadSafe(String value, Node n, ErrorDispatcher err) throws JasperException { if ("true".equalsIgnoreCase(value)) { isThreadSafe = true; diff --git a/java/org/apache/jasper/compiler/Parser.java b/java/org/apache/jasper/compiler/Parser.java index 73868995a8..aeaed767bb 100644 --- a/java/org/apache/jasper/compiler/Parser.java +++ b/java/org/apache/jasper/compiler/Parser.java @@ -247,8 +247,8 @@ class Parser implements TagConstants { buf.append(ch); reader.nextChar(); ch = (char) reader.peekChar(); - } while (Character.isLetter(ch) || Character.isDigit(ch) || - ch == '.' || ch == '_' || ch == '-' || ch == ':'); + } while (Character.isLetter(ch) || Character.isDigit(ch) || ch == '.' || ch == '_' || ch == '-' || + ch == ':'); return buf.toString(); } return null; diff --git a/java/org/apache/jasper/compiler/Validator.java b/java/org/apache/jasper/compiler/Validator.java index 6d274e414a..765bbd6ae6 100644 --- a/java/org/apache/jasper/compiler/Validator.java +++ b/java/org/apache/jasper/compiler/Validator.java @@ -1025,7 +1025,7 @@ class Validator { } for (int j = 0; tldAttrs != null && j < tldAttrs.length; j++) { if (attrs.getLocalName(i).equals(tldAttrs[j].getName()) && (attrs.getURI(i) == null || - attrs.getURI(i).isEmpty() || attrs.getURI(i).equals(n.getURI()))) { + attrs.getURI(i).isEmpty() || attrs.getURI(i).equals(n.getURI()))) { TagAttributeInfo tldAttr = tldAttrs[j]; if (tldAttr.canBeRequestTime() || tldAttr.isDeferredMethod() || tldAttr.isDeferredValue()) { // JSP diff --git a/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java b/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java index 38d9383a57..930130b01a 100644 --- a/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java +++ b/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java @@ -81,8 +81,8 @@ public interface TagPluginContext { String getConstantAttribute(String attribute); /** - * Generate codes to evaluate value of an attribute in the custom tag The codes is a Java expression. NOTE: Currently - * cannot handle attributes that are fragments. + * Generate codes to evaluate value of an attribute in the custom tag The codes is a Java expression. NOTE: + * Currently cannot handle attributes that are fragments. * * @param attribute The specified attribute */ diff --git a/java/org/apache/jasper/runtime/BodyContentImpl.java b/java/org/apache/jasper/runtime/BodyContentImpl.java index a8222caa70..90bd2a5a40 100644 --- a/java/org/apache/jasper/runtime/BodyContentImpl.java +++ b/java/org/apache/jasper/runtime/BodyContentImpl.java @@ -27,8 +27,8 @@ import jakarta.servlet.jsp.tagext.BodyContent; import org.apache.jasper.compiler.Localizer; /** - * Write text to a character-output stream, buffering characters to provide efficient writing of single - * characters, arrays, and strings. Provide support for discarding the output that has been buffered. + * Write text to a character-output stream, buffering characters to provide efficient writing of single characters, + * arrays, and strings. Provide support for discarding the output that has been buffered. * * @author Rajiv Mordani * @author Jan Luehe diff --git a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java index ec4b06044f..326af2594c 100644 --- a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java +++ b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java @@ -587,8 +587,8 @@ public class JspRuntimeLibrary { ProtectedFunctionMapper functionMapper) throws JasperException { try { Method method = getWriteMethod(bean.getClass(), prop); - method.invoke(bean, PageContextImpl.proprietaryEvaluate(expression, - method.getParameterTypes()[0], pageContext, functionMapper)); + method.invoke(bean, PageContextImpl.proprietaryEvaluate(expression, method.getParameterTypes()[0], + pageContext, functionMapper)); } catch (Exception e) { Throwable thr = ExceptionUtils.unwrapInvocationTargetException(e); ExceptionUtils.handleThrowable(thr); @@ -970,9 +970,9 @@ public class JspRuntimeLibrary { * This method parallels the logic of {@code SetSupport.doEndTag()}. * * @param pageContext pageContext - * @param var name of the variable - * @param value value to store - * @param scope scope + * @param var name of the variable + * @param value value to store + * @param scope scope */ public static void nonstandardSetTag(jakarta.servlet.jsp.PageContext pageContext, String var, Object value, int scope) { diff --git a/java/org/apache/jasper/runtime/JspWriterImpl.java b/java/org/apache/jasper/runtime/JspWriterImpl.java index ec8256c41e..89fde84b8d 100644 --- a/java/org/apache/jasper/runtime/JspWriterImpl.java +++ b/java/org/apache/jasper/runtime/JspWriterImpl.java @@ -27,9 +27,9 @@ import org.apache.jasper.Constants; import org.apache.jasper.compiler.Localizer; /** - * Write text to a character-output stream, buffering characters to provide efficient writing of single - * characters, arrays, and strings. Provide support for discarding the output that has been buffered. This needs - * revisiting when the buffering problems in the JSP spec are fixed -akv + * Write text to a character-output stream, buffering characters to provide efficient writing of single characters, + * arrays, and strings. Provide support for discarding the output that has been buffered. This needs revisiting when the + * buffering problems in the JSP spec are fixed -akv * * @author Anil K. Vijendran */ diff --git a/java/org/apache/jasper/servlet/JspServlet.java b/java/org/apache/jasper/servlet/JspServlet.java index 07a5a059dc..629a1e8b61 100644 --- a/java/org/apache/jasper/servlet/JspServlet.java +++ b/java/org/apache/jasper/servlet/JspServlet.java @@ -45,10 +45,9 @@ import org.apache.tomcat.PeriodicEventListener; import org.apache.tomcat.util.security.Escape; /** - * The Jasper JSP engine. The servlet container is responsible for providing a URLClassLoader for the web - * application context Jasper is being used in. Jasper will try to get the Tomcat ServletContext attribute for its - * ServletContext class loader, if that fails, it uses the parent class loader. In either case, it must be a - * URLClassLoader. + * The Jasper JSP engine. The servlet container is responsible for providing a URLClassLoader for the web application + * context Jasper is being used in. Jasper will try to get the Tomcat ServletContext attribute for its ServletContext + * class loader, if that fails, it uses the parent class loader. In either case, it must be a URLClassLoader. * * @author Anil K. Vijendran * @author Harish Prabandham diff --git a/java/org/apache/jasper/servlet/JspServletWrapper.java b/java/org/apache/jasper/servlet/JspServletWrapper.java index bf765f6d4b..cab2254c37 100644 --- a/java/org/apache/jasper/servlet/JspServletWrapper.java +++ b/java/org/apache/jasper/servlet/JspServletWrapper.java @@ -49,10 +49,9 @@ import org.apache.tomcat.InstanceManager; import org.apache.tomcat.Jar; /** - * The Jasper JSP engine. The servlet container is responsible for providing a URLClassLoader for the web - * application context Jasper is being used in. Jasper will try to get the Tomcat ServletContext attribute for its - * ServletContext class loader, if that fails, it uses the parent class loader. In either case, it must be a - * URLClassLoader. + * The Jasper JSP engine. The servlet container is responsible for providing a URLClassLoader for the web application + * context Jasper is being used in. Jasper will try to get the Tomcat ServletContext attribute for its ServletContext + * class loader, if that fails, it uses the parent class loader. In either case, it must be a URLClassLoader. * * @author Anil K. Vijendran * @author Harish Prabandham @@ -513,7 +512,8 @@ public class JspServletWrapper { * Attempts to construct a JasperException that contains helpful information about what went wrong. Uses the JSP * compiler system to translate the line number in the generated servlet that originated the exception to a line * number in the JSP. Then constructs an exception containing that information, and a snippet of the JSP to help - * debugging. Please see <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=37062">BZ 37062</a> for more details. + * debugging. Please see <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=37062">BZ 37062</a> for more + * details. * </p> * * @param ex the exception that was the cause of the problem. diff --git a/java/org/apache/tomcat/util/concurrent/KeyedReentrantReadWriteLock.java b/java/org/apache/tomcat/util/concurrent/KeyedReentrantReadWriteLock.java index d1c0541d62..46699681ff 100644 --- a/java/org/apache/tomcat/util/concurrent/KeyedReentrantReadWriteLock.java +++ b/java/org/apache/tomcat/util/concurrent/KeyedReentrantReadWriteLock.java @@ -31,8 +31,8 @@ import org.apache.tomcat.util.res.StringManager; /** * Provides a reentrant read/write lock for a given key. Any locks obtained from an instance of this class using the * same key will use the same underlying reentrant read/write lock as long as at least one lock for that key remains in - * use. Once no locks are in use for the given key, the lock is eligible for GC and the next lock obtained using that key - * will use a new underlying reentrant read/write lock. + * use. Once no locks are in use for the given key, the lock is eligible for GC and the next lock obtained using that + * key will use a new underlying reentrant read/write lock. * <p> * The class is used when Tomcat needs to manage concurrent access to components identified by a key (e.g. sessions). * <p> diff --git a/java/org/apache/tomcat/util/net/SecureNioChannel.java b/java/org/apache/tomcat/util/net/SecureNioChannel.java index a593bd9677..d866c815e9 100644 --- a/java/org/apache/tomcat/util/net/SecureNioChannel.java +++ b/java/org/apache/tomcat/util/net/SecureNioChannel.java @@ -209,7 +209,7 @@ public class SecureNioChannel extends NioChannel { } // fall down to NEED_UNWRAP on the same call, will result in a // BUFFER_UNDERFLOW if it needs data - //$FALL-THROUGH$ + // $FALL-THROUGH$ case NEED_UNWRAP: // perform the unwrap function handshake = handshakeUnwrap(read); diff --git a/java/org/apache/tomcat/util/net/jsse/PEMFile.java b/java/org/apache/tomcat/util/net/jsse/PEMFile.java index 95d18d93aa..11ae48e7ac 100644 --- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java +++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java @@ -486,7 +486,8 @@ public class PEMFile { try { return KeyFactory.getInstance(algorithm).generatePrivate(keySpec); } catch (InvalidKeySpecException e) { - exception.addSuppressed(new InvalidKeySpecException(sm.getString("pemFile.parseError.algorithm", algorithm), e)); + exception.addSuppressed(new InvalidKeySpecException( + sm.getString("pemFile.parseError.algorithm", algorithm), e)); } } } else { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org