This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push: new 03d5695f13 Re-apply automatic formatting excluding forks of Commons projects 03d5695f13 is described below commit 03d5695f13c539c44286c5e1351c0565acab8e9b Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Aug 29 12:26:48 2025 +0100 Re-apply automatic formatting excluding forks of Commons projects --- java/jakarta/el/MapELResolver.java | 2 +- java/jakarta/el/RecordELResolver.java | 4 +- java/jakarta/el/Util.java | 4 +- java/jakarta/security/auth/message/ClientAuth.java | 8 +- java/jakarta/security/auth/message/ServerAuth.java | 8 +- .../callback/PasswordValidationCallback.java | 4 +- java/jakarta/servlet/GenericFilter.java | 4 +- java/jakarta/servlet/ServletConnection.java | 6 +- java/jakarta/servlet/ServletContext.java | 6 +- java/jakarta/servlet/ServletResponse.java | 3 +- java/jakarta/servlet/http/HttpServletRequest.java | 11 +- java/jakarta/servlet/http/Part.java | 10 +- .../servlet/jsp/tagext/TagAttributeInfo.java | 11 +- java/org/apache/catalina/WebResourceLockSet.java | 4 +- .../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/SSLAuthenticator.java | 3 +- .../jaspic/AuthConfigFactoryImpl.java | 2 +- java/org/apache/catalina/connector/Connector.java | 4 +- .../apache/catalina/connector/OutputBuffer.java | 4 +- java/org/apache/catalina/core/StandardContext.java | 3 +- .../catalina/deploy/NamingResourcesImpl.java | 8 +- java/org/apache/catalina/filters/CorsFilter.java | 10 +- .../org/apache/catalina/filters/ExpiresFilter.java | 2 +- .../apache/catalina/filters/RemoteIpFilter.java | 31 +++-- .../apache/catalina/ha/session/BackupManager.java | 2 +- .../apache/catalina/ha/session/DeltaRequest.java | 5 +- .../apache/catalina/ha/session/SessionMessage.java | 4 +- .../apache/catalina/ha/tcp/ReplicationValve.java | 3 +- .../catalina/manager/HTMLManagerServlet.java | 20 +++ .../apache/catalina/manager/ManagerServlet.java | 9 +- java/org/apache/catalina/mbeans/MBeanUtils.java | 10 +- .../apache/catalina/realm/GenericPrincipal.java | 34 ++--- 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 +- java/org/apache/catalina/util/TLSUtil.java | 7 +- .../catalina/util/TimeBucketCounterBase.java | 6 +- java/org/apache/catalina/util/XMLWriter.java | 4 +- .../catalina/valves/AbstractAccessLogValve.java | 3 +- .../valves/CrawlerSessionManagerValve.java | 4 +- .../apache/catalina/valves/ErrorReportValve.java | 3 +- .../catalina/valves/ExtendedAccessLogValve.java | 6 +- java/org/apache/catalina/valves/FilterValve.java | 3 +- .../catalina/valves/JsonErrorReportValve.java | 7 +- .../catalina/valves/ParameterLimitValve.java | 6 +- java/org/apache/catalina/valves/RemoteIpValve.java | 15 +-- .../valves/rewrite/QuotedStringTokenizer.java | 5 +- .../catalina/valves/rewrite/RewriteValve.java | 5 +- java/org/apache/catalina/webresources/Cache.java | 5 +- .../catalina/webresources/DirResourceSet.java | 1 - java/org/apache/coyote/CompressionConfig.java | 6 +- java/org/apache/coyote/Request.java | 4 +- java/org/apache/coyote/UpgradeToken.java | 2 +- java/org/apache/coyote/ajp/AjpProcessor.java | 6 +- java/org/apache/el/lang/ELSupport.java | 13 +- java/org/apache/el/util/ReflectionUtil.java | 8 +- 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 | 32 +++-- java/org/apache/jasper/compiler/JspReader.java | 6 +- java/org/apache/jasper/compiler/Node.java | 6 +- 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 | 14 +- .../concurrent/KeyedReentrantReadWriteLock.java | 4 +- .../apache/tomcat/util/net/SecureNioChannel.java | 2 +- java/org/apache/tomcat/util/net/jsse/PEMFile.java | 3 +- 97 files changed, 394 insertions(+), 369 deletions(-) diff --git a/java/jakarta/el/MapELResolver.java b/java/jakarta/el/MapELResolver.java index 3609f16566..973d2ee35d 100644 --- a/java/jakarta/el/MapELResolver.java +++ b/java/jakarta/el/MapELResolver.java @@ -39,7 +39,7 @@ public class MapELResolver extends ELResolver { public Class<?> getType(ELContext context, Object base, Object property) { Objects.requireNonNull(context); - if (base instanceof Map<?, ?> map) { + if (base instanceof Map<?,?> map) { context.setPropertyResolved(base, property); if (readOnly || map.getClass() == UNMODIFIABLE) { diff --git a/java/jakarta/el/RecordELResolver.java b/java/jakarta/el/RecordELResolver.java index a09b22a293..37c0cc64a3 100644 --- a/java/jakarta/el/RecordELResolver.java +++ b/java/jakarta/el/RecordELResolver.java @@ -28,8 +28,8 @@ import java.util.Objects; * <p> * This resolver is always read-only since {@link Record}s are always read-only. * <p> - * {@code ELResolver}s are combined using {@link CompositeELResolver}s to define rich semantics for evaluating - * an expression. See the javadocs for {@link ELResolver} for details. + * {@code ELResolver}s are combined using {@link CompositeELResolver}s to define rich semantics for evaluating an + * expression. See the javadocs for {@link ELResolver} for details. * * @since EL 6.0 */ diff --git a/java/jakarta/el/Util.java b/java/jakarta/el/Util.java index a415eb9bb8..2718e2e4d5 100644 --- a/java/jakarta/el/Util.java +++ b/java/jakarta/el/Util.java @@ -631,8 +631,8 @@ class Util { /* * This class duplicates code in org.apache.el.util.ReflectionUtil. When making changes keep the code in sync. */ - private record MatchResult(boolean varArgs, int exactCount, int assignableCount, int coercibleCount, int varArgsCount, - boolean bridge) implements Comparable<MatchResult> { + private record MatchResult(boolean varArgs, int exactCount, int assignableCount, int coercibleCount, + int varArgsCount, boolean bridge) implements Comparable<MatchResult> { public boolean isVarArgs() { return varArgs; diff --git a/java/jakarta/security/auth/message/ClientAuth.java b/java/jakarta/security/auth/message/ClientAuth.java index c907a05644..79bda35aff 100644 --- a/java/jakarta/security/auth/message/ClientAuth.java +++ b/java/jakarta/security/auth/message/ClientAuth.java @@ -28,8 +28,8 @@ public interface ClientAuth { * * @return An AuthStatus instance that represents the result of the authentication * - * @throws AuthException If a failure occurred in a manner that prevented the failure from being communicated - * via messageInfo + * @throws AuthException If a failure occurred in a manner that prevented the failure from being communicated via + * messageInfo */ AuthStatus secureRequest(MessageInfo messageInfo, Subject clientSubject) throws AuthException; @@ -42,8 +42,8 @@ public interface ClientAuth { * * @return An AuthStatus instance that represents the result of the validation * - * @throws AuthException If a failure occurred in a manner that prevented the failure from being communicated - * via messageInfo + * @throws AuthException If a failure occurred in a manner that prevented the failure from being communicated via + * messageInfo */ default AuthStatus validateResponse(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject) throws AuthException { diff --git a/java/jakarta/security/auth/message/ServerAuth.java b/java/jakarta/security/auth/message/ServerAuth.java index a793aa983b..8df08f055a 100644 --- a/java/jakarta/security/auth/message/ServerAuth.java +++ b/java/jakarta/security/auth/message/ServerAuth.java @@ -29,8 +29,8 @@ public interface ServerAuth { * * @return An AuthStatus instance that represents the result of the validation * - * @throws AuthException If a failure occurred in a manner that prevented the failure from being communicated - * via messageInfo + * @throws AuthException If a failure occurred in a manner that prevented the failure from being communicated via + * messageInfo */ AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject) throws AuthException; @@ -43,8 +43,8 @@ public interface ServerAuth { * * @return An AuthStatus instance that represents the result of the authentication * - * @throws AuthException If a failure occurred in a manner that prevented the failure from being communicated - * via messageInfo + * @throws AuthException If a failure occurred in a manner that prevented the failure from being communicated via + * messageInfo */ default AuthStatus secureResponse(MessageInfo messageInfo, Subject serviceSubject) throws AuthException { return AuthStatus.SUCCESS; diff --git a/java/jakarta/security/auth/message/callback/PasswordValidationCallback.java b/java/jakarta/security/auth/message/callback/PasswordValidationCallback.java index 37f957de6c..ae9f6bdecc 100644 --- a/java/jakarta/security/auth/message/callback/PasswordValidationCallback.java +++ b/java/jakarta/security/auth/message/callback/PasswordValidationCallback.java @@ -22,8 +22,8 @@ import javax.security.auth.Subject; import javax.security.auth.callback.Callback; /** - * Callback that enables an authentication module to supply a username and password (to a runtime?) and determine if - * the result of validation. + * Callback that enables an authentication module to supply a username and password (to a runtime?) and determine if the + * result of validation. */ public class PasswordValidationCallback implements Callback { diff --git a/java/jakarta/servlet/GenericFilter.java b/java/jakarta/servlet/GenericFilter.java index c7e5ed4969..67b7962d79 100644 --- a/java/jakarta/servlet/GenericFilter.java +++ b/java/jakarta/servlet/GenericFilter.java @@ -76,8 +76,8 @@ public abstract class GenericFilter implements Filter, FilterConfig, Serializabl /** - * Convenience method for subclasses to save them having to call <code>super.init(config)</code>. This is a NO-OP - * by default. + * Convenience method for subclasses to save them having to call <code>super.init(config)</code>. This is a NO-OP by + * default. * * @throws ServletException If an exception occurs that interrupts the Filter's normal operation */ diff --git a/java/jakarta/servlet/ServletConnection.java b/java/jakarta/servlet/ServletConnection.java index 559e0b0549..8906f65c90 100644 --- a/java/jakarta/servlet/ServletConnection.java +++ b/java/jakarta/servlet/ServletConnection.java @@ -73,9 +73,9 @@ public interface ServletConnection { String getProtocolConnectionId(); /** - * Determine whether the incoming network connection to the server used encryption or not. Note that where a - * reverse proxy is used, the application may have a different view as to whether encryption is being used due to - * the use of headers like {@code X-Forwarded-Proto}. + * Determine whether the incoming network connection to the server used encryption or not. Note that where a reverse + * proxy is used, the application may have a different view as to whether encryption is being used due to the use of + * headers like {@code X-Forwarded-Proto}. * * @return {@code true} if the incoming network connection used encryption, otherwise {@code false} */ diff --git a/java/jakarta/servlet/ServletContext.java b/java/jakarta/servlet/ServletContext.java index 9f38494ede..15eba5a3a5 100644 --- a/java/jakarta/servlet/ServletContext.java +++ b/java/jakarta/servlet/ServletContext.java @@ -72,9 +72,9 @@ public interface ServletContext { * Returns a <code>ServletContext</code> object that corresponds to a specified URL on the server. * <p> * This method allows servlets to gain access to the context for various parts of the server, and as needed obtain - * {@link RequestDispatcher} objects from the context. The given path must begin with "/", is interpreted - * relative to the server's document root and is matched against the context roots of other web applications hosted - * on this container. + * {@link RequestDispatcher} objects from the context. The given path must begin with "/", is interpreted relative + * to the server's document root and is matched against the context roots of other web applications hosted on this + * container. * <p> * In a security conscious environment, the servlet container may return <code>null</code> for a given URL. * diff --git a/java/jakarta/servlet/ServletResponse.java b/java/jakarta/servlet/ServletResponse.java index 869a3a6d71..78abf5d246 100644 --- a/java/jakarta/servlet/ServletResponse.java +++ b/java/jakarta/servlet/ServletResponse.java @@ -66,7 +66,8 @@ public interface ServletResponse { * <code>getWriter</code> has been called or after the response has been committed have no effect on the character * encoding. If no character encoding has been specified, <code>ISO-8859-1</code> is returned. * <p> - * See <a href="http://www.ietf.org/rfc/rfc2047.txt">RFC 2047</a> for more information about character encoding and MIME. + * See <a href="http://www.ietf.org/rfc/rfc2047.txt">RFC 2047</a> for more information about character encoding and + * MIME. * * @return a <code>String</code> specifying the name of the character encoding, for example, <code>UTF-8</code> */ diff --git a/java/jakarta/servlet/http/HttpServletRequest.java b/java/jakarta/servlet/http/HttpServletRequest.java index 4b7e183f15..f0c779b2cd 100644 --- a/java/jakarta/servlet/http/HttpServletRequest.java +++ b/java/jakarta/servlet/http/HttpServletRequest.java @@ -77,8 +77,8 @@ public interface HttpServletRequest extends ServletRequest { * <code>Date</code> object. Use this method with headers that contain dates, such as * <code>If-Modified-Since</code>. * <p> - * The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name - * is case-insensitive. + * The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is + * case-insensitive. * <p> * If the request did not have a header of the specified name, this method returns -1. If the header can't be * converted to a date, the method throws an <code>IllegalArgumentException</code>. @@ -297,8 +297,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> @@ -320,7 +320,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/jakarta/servlet/http/Part.java b/java/jakarta/servlet/http/Part.java index 92027e99f6..2d4898ba8c 100644 --- a/java/jakarta/servlet/http/Part.java +++ b/java/jakarta/servlet/http/Part.java @@ -69,11 +69,11 @@ public interface Part { long getSize(); /** - * A convenience method to write an uploaded part to disk. The client code is not concerned with whether the - * part is stored in memory, or on disk in a temporary location. They just want to write the uploaded part to a - * file. This method is not guaranteed to succeed if called more than once for the same part. This allows a - * particular implementation to use, for example, file renaming, where possible, rather than copying all of the - * underlying data, thus gaining a significant performance benefit. + * A convenience method to write an uploaded part to disk. The client code is not concerned with whether the part is + * stored in memory, or on disk in a temporary location. They just want to write the uploaded part to a file. This + * method is not guaranteed to succeed if called more than once for the same part. This allows a particular + * implementation to use, for example, file renaming, where possible, rather than copying all of the underlying + * data, thus gaining a significant performance benefit. * * @param fileName The location into which the uploaded part should be stored. Relative locations are relative to * {@link jakarta.servlet.MultipartConfigElement#getLocation()} diff --git a/java/jakarta/servlet/jsp/tagext/TagAttributeInfo.java b/java/jakarta/servlet/jsp/tagext/TagAttributeInfo.java index 54e1c86c3f..82ecb4250a 100644 --- a/java/jakarta/servlet/jsp/tagext/TagAttributeInfo.java +++ b/java/jakarta/servlet/jsp/tagext/TagAttributeInfo.java @@ -165,14 +165,9 @@ public class TagAttributeInfo { */ @Override public String toString() { - return "name = " + name + " " + - "type = " + type + " " + - "reqTime = " + reqTime + " " + - "required = " + required + " " + - "fragment = " + fragment + " " + - "deferredValue = " + deferredValue + " " + - "expectedTypeName = " + expectedTypeName + " " + - "deferredMethod = " + deferredMethod + " " + + return "name = " + name + " " + "type = " + type + " " + "reqTime = " + reqTime + " " + "required = " + + required + " " + "fragment = " + fragment + " " + "deferredValue = " + deferredValue + " " + + "expectedTypeName = " + expectedTypeName + " " + "deferredMethod = " + deferredMethod + " " + "methodSignature = " + methodSignature; } diff --git a/java/org/apache/catalina/WebResourceLockSet.java b/java/org/apache/catalina/WebResourceLockSet.java index e6620561c3..fcfdcbc971 100644 --- a/java/org/apache/catalina/WebResourceLockSet.java +++ b/java/org/apache/catalina/WebResourceLockSet.java @@ -27,8 +27,8 @@ public interface WebResourceLockSet { /** * Obtain a reentrant read/write lock for the resource at the provided path. The resource is not required to exist. - * Multiple calls to this method with the same path will return the same lock provided that at least one instance - * of the lock remains in use between the calls. + * Multiple calls to this method with the same path will return the same lock provided that at least one instance of + * the lock remains in use between the calls. * * @param path The path for which the lock should be obtained * 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/SSLAuthenticator.java b/java/org/apache/catalina/authenticator/SSLAuthenticator.java index c4d7012563..2364399874 100644 --- a/java/org/apache/catalina/authenticator/SSLAuthenticator.java +++ b/java/org/apache/catalina/authenticator/SSLAuthenticator.java @@ -197,7 +197,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 7d2c1ae0e4..8a0f3f2a07 100644 --- a/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java +++ b/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java @@ -521,7 +521,7 @@ public class AuthConfigFactoryImpl extends AuthConfigFactory { private record SingleModuleServerAuthContext(ServerAuthModule module) implements ServerAuthContext { @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/connector/Connector.java b/java/org/apache/catalina/connector/Connector.java index d41bde2e8f..49bc0d7a7f 100644 --- a/java/org/apache/catalina/connector/Connector.java +++ b/java/org/apache/catalina/connector/Connector.java @@ -1055,7 +1055,7 @@ public class Connector extends LifecycleMBeanBase { } if (JreCompat.isJre22Available() && OpenSSLStatus.getUseOpenSSL() && OpenSSLStatus.isAvailable() && - protocolHandler instanceof AbstractHttp11Protocol<?> jsseProtocolHandler) { + protocolHandler instanceof AbstractHttp11Protocol<?> jsseProtocolHandler) { // Use FFM and OpenSSL if available if (jsseProtocolHandler.isSSLEnabled() && jsseProtocolHandler.getSslImplementationName() == null) { // OpenSSL is compatible with the JSSE configuration, so use it if it is available @@ -1063,7 +1063,7 @@ public class Connector extends LifecycleMBeanBase { .setSslImplementationName("org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"); } } else if (AprStatus.isAprAvailable() && AprStatus.getUseOpenSSL() && - protocolHandler instanceof AbstractHttp11Protocol<?> jsseProtocolHandler) { + protocolHandler instanceof AbstractHttp11Protocol<?> jsseProtocolHandler) { // Use tomcat-native and OpenSSL otherwise, if available if (jsseProtocolHandler.isSSLEnabled() && jsseProtocolHandler.getSslImplementationName() == null) { // OpenSSL is compatible with the JSSE configuration, so use it if APR is available diff --git a/java/org/apache/catalina/connector/OutputBuffer.java b/java/org/apache/catalina/connector/OutputBuffer.java index 8d25efbb96..9ae1374c3f 100644 --- a/java/org/apache/catalina/connector/OutputBuffer.java +++ b/java/org/apache/catalina/connector/OutputBuffer.java @@ -419,8 +419,8 @@ public class OutputBuffer extends Writer { /* * Handle the requirements of section 5.7 of the Servlet specification - Closure of the Response Object. * - * Currently, this just handles the simple case. There is work in progress to better define what should happen if - * an attempt is made to write > content-length bytes. When that work is complete, this is likely where the + * Currently, this just handles the simple case. There is work in progress to better define what should happen + * if an attempt is made to write > content-length bytes. When that work is complete, this is likely where the * implementation will end up. */ if (contentLength != -1 && bytesWritten >= contentLength) { diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java index c9a1e23f6b..d352d73e6b 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -5307,7 +5307,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 fb32ac3a68..f672aadb6d 100644 --- a/java/org/apache/catalina/deploy/NamingResourcesImpl.java +++ b/java/org/apache/catalina/deploy/NamingResourcesImpl.java @@ -515,8 +515,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() { @@ -651,8 +651,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 8f32bcead9..1ca0fd829a 100644 --- a/java/org/apache/catalina/filters/CorsFilter.java +++ b/java/org/apache/catalina/filters/CorsFilter.java @@ -129,7 +129,8 @@ public class CorsFilter extends GenericFilter { @Override public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { - if (!(servletRequest instanceof HttpServletRequest request) || !(servletResponse instanceof HttpServletResponse response)) { + if (!(servletRequest instanceof HttpServletRequest request) || + !(servletResponse instanceof HttpServletResponse response)) { throw new ServletException(sm.getString("corsFilter.onlyHttp")); } @@ -544,7 +545,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(); @@ -553,7 +554,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; @@ -891,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 34f18d2d7e..1377f5273a 100644 --- a/java/org/apache/catalina/filters/ExpiresFilter.java +++ b/java/org/apache/catalina/filters/ExpiresFilter.java @@ -490,7 +490,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 7d83b3d9fe..e72f939d4f 100644 --- a/java/org/apache/catalina/filters/RemoteIpFilter.java +++ b/java/org/apache/catalina/filters/RemoteIpFilter.java @@ -191,6 +191,7 @@ import org.apache.tomcat.util.res.StringManager; * <p> * XForwardedFilter configuration: * </p> + * * <pre> * <filter> * <filter-name>RemoteIpFilter</filter-name> @@ -217,7 +218,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> @@ -270,6 +272,7 @@ import org.apache.tomcat.util.res.StringManager; * <p> * RemoteIpFilter configuration: * </p> + * * <pre> * <filter> * <filter-name>RemoteIpFilter</filter-name> @@ -296,7 +299,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> @@ -332,6 +336,7 @@ import org.apache.tomcat.util.res.StringManager; * <p> * RemoteIpFilter configuration: * </p> + * * <pre> * <filter> * <filter-name>RemoteIpFilter</filter-name> @@ -358,7 +363,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> @@ -395,6 +401,7 @@ import org.apache.tomcat.util.res.StringManager; * <p> * RemoteIpFilter configuration: * </p> + * * <pre> * <filter> * <filter-name>RemoteIpFilter</filter-name> @@ -421,7 +428,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> @@ -686,14 +694,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/BackupManager.java b/java/org/apache/catalina/ha/session/BackupManager.java index 2ce585ada3..ffd9a858d3 100644 --- a/java/org/apache/catalina/ha/session/BackupManager.java +++ b/java/org/apache/catalina/ha/session/BackupManager.java @@ -177,7 +177,7 @@ public class BackupManager extends ClusterManagerBase implements MapOwner, Distr setState(LifecycleState.STOPPING); - if (sessions instanceof LazyReplicatedMap<String, Session> map) { + if (sessions instanceof LazyReplicatedMap<String,Session> map) { map.breakdown(); } diff --git a/java/org/apache/catalina/ha/session/DeltaRequest.java b/java/org/apache/catalina/ha/session/DeltaRequest.java index d37592679b..4f2cb7c06e 100644 --- a/java/org/apache/catalina/ha/session/DeltaRequest.java +++ b/java/org/apache/catalina/ha/session/DeltaRequest.java @@ -430,9 +430,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 e5c38fce32..76cdb01746 100644 --- a/java/org/apache/catalina/ha/tcp/ReplicationValve.java +++ b/java/org/apache/catalina/ha/tcp/ReplicationValve.java @@ -544,8 +544,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/manager/HTMLManagerServlet.java b/java/org/apache/catalina/manager/HTMLManagerServlet.java index 6aa91dce25..f4f5506e66 100644 --- a/java/org/apache/catalina/manager/HTMLManagerServlet.java +++ b/java/org/apache/catalina/manager/HTMLManagerServlet.java @@ -272,6 +272,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) { @@ -292,6 +293,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, @@ -570,7 +572,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) { @@ -588,7 +592,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) { @@ -607,7 +613,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) { @@ -625,7 +633,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) { @@ -643,7 +653,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) { @@ -660,7 +672,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) { @@ -742,6 +756,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) { @@ -764,6 +779,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 */ @@ -849,6 +865,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 */ @@ -898,6 +915,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 */ @@ -920,6 +938,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) { @@ -958,6 +977,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 1fbdbf8e7e..87ecf5a889 100644 --- a/java/org/apache/catalina/manager/ManagerServlet.java +++ b/java/org/apache/catalina/manager/ManagerServlet.java @@ -375,8 +375,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); @@ -736,7 +735,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; } } @@ -910,7 +910,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 f70b5e0894..14ae69c32f 100644 --- a/java/org/apache/catalina/mbeans/MBeanUtils.java +++ b/java/org/apache/catalina/mbeans/MBeanUtils.java @@ -448,7 +448,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()); } @@ -465,8 +465,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()); } @@ -483,8 +483,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/GenericPrincipal.java b/java/org/apache/catalina/realm/GenericPrincipal.java index 3a9bb35962..dfefb126ec 100644 --- a/java/org/apache/catalina/realm/GenericPrincipal.java +++ b/java/org/apache/catalina/realm/GenericPrincipal.java @@ -252,24 +252,24 @@ public class GenericPrincipal implements TomcatPrincipal, Serializable { } private record SerializablePrincipal(String name, String[] roles, Principal principal, - Map<String, Object> attributes) implements Serializable { - @Serial - private static final long serialVersionUID = 1L; - - private SerializablePrincipal(String name, String[] roles, Principal principal, Map<String, Object> attributes) { - this.name = name; - this.roles = roles; - if (principal instanceof Serializable) { - this.principal = principal; - } else { - this.principal = null; - } - this.attributes = attributes; + Map<String,Object> attributes) implements Serializable { + @Serial + private static final long serialVersionUID = 1L; + + private SerializablePrincipal(String name, String[] roles, Principal principal, Map<String,Object> attributes) { + this.name = name; + this.roles = roles; + if (principal instanceof Serializable) { + this.principal = principal; + } else { + this.principal = null; } + this.attributes = attributes; + } - @Serial - private Object readResolve() { - return new GenericPrincipal(name, Arrays.asList(roles), principal, null, null, attributes); - } + @Serial + private Object readResolve() { + return new GenericPrincipal(name, Arrays.asList(roles), principal, null, null, attributes); } + } } diff --git a/java/org/apache/catalina/realm/JNDIRealm.java b/java/org/apache/catalina/realm/JNDIRealm.java index 03ec9fcb79..033c52ba0e 100644 --- a/java/org/apache/catalina/realm/JNDIRealm.java +++ b/java/org/apache/catalina/realm/JNDIRealm.java @@ -1158,9 +1158,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. */ /* @@ -1834,7 +1834,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 { @@ -2762,8 +2762,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 0297a9cd7f..984dd6c4dc 100644 --- a/java/org/apache/catalina/realm/LockOutRealm.java +++ b/java/org/apache/catalina/realm/LockOutRealm.java @@ -220,7 +220,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 7893b61f65..1b96bd87a8 100644 --- a/java/org/apache/catalina/realm/UserDatabaseRealm.java +++ b/java/org/apache/catalina/realm/UserDatabaseRealm.java @@ -113,8 +113,7 @@ public class UserDatabaseRealm extends RealmBase { * Determines whether this Realm is configured to obtain the associated {@link UserDatabase} from the global JNDI * context or a local (web application) JNDI context. * - * @return {@code true} if a local JNDI context will be used, {@code false} if the 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 99f8b4a33f..a3a98911c6 100644 --- a/java/org/apache/catalina/servlets/DefaultServlet.java +++ b/java/org/apache/catalina/servlets/DefaultServlet.java @@ -679,8 +679,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 } @@ -1218,7 +1218,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)) { @@ -2454,8 +2454,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 9c43108c88..828a1222f8 100644 --- a/java/org/apache/catalina/servlets/WebdavServlet.java +++ b/java/org/apache/catalina/servlets/WebdavServlet.java @@ -1845,7 +1845,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; } @@ -1973,7 +1973,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); @@ -2750,8 +2750,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 31a7894d05..204cd9ab94 100644 --- a/java/org/apache/catalina/ssi/SSIServletExternalResolver.java +++ b/java/org/apache/catalina/ssi/SSIServletExternalResolver.java @@ -301,8 +301,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 b2ba94b240..7fe0f6fa9a 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 11cbdc2839..422f358f4f 100644 --- a/java/org/apache/catalina/storeconfig/LoaderSF.java +++ b/java/org/apache/catalina/storeconfig/LoaderSF.java @@ -62,6 +62,6 @@ public class LoaderSF extends StoreFactoryBase { return false; } 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 18cc4ea6f1..ab9bf1b6e3 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 6e91edeed0..8c09e275d5 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 fcb058b76f..28f11ca28c 100644 --- a/java/org/apache/catalina/tribes/io/ChannelData.java +++ b/java/org/apache/catalina/tribes/io/ChannelData.java @@ -339,9 +339,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 5cd4e96a88..f3ab1142a9 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 042d661aad..465b8dd83c 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 03e7e02d42..7ba186ead1 100644 --- a/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java +++ b/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java @@ -172,7 +172,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); @@ -206,7 +206,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)); @@ -1256,7 +1256,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++; } @@ -1430,11 +1430,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() + ";]"; } } @@ -1473,8 +1470,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() { @@ -1497,7 +1494,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 3a74766057..f66077ffc9 100644 --- a/java/org/apache/catalina/util/Introspection.java +++ b/java/org/apache/catalina/util/Introspection.java @@ -56,7 +56,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/TLSUtil.java b/java/org/apache/catalina/util/TLSUtil.java index f0c13a9aef..0286ef6020 100644 --- a/java/org/apache/catalina/util/TLSUtil.java +++ b/java/org/apache/catalina/util/TLSUtil.java @@ -34,9 +34,10 @@ public class TLSUtil { public static boolean isTLSRequestAttribute(String name) { return switch (name) { case Globals.CERTIFICATES_ATTR, Globals.SECURE_PROTOCOL_ATTR, Globals.CIPHER_SUITE_ATTR, - Globals.KEY_SIZE_ATTR, Globals.SSL_SESSION_ID_ATTR, Globals.SSL_SESSION_MGR_ATTR, - SSLSupport.PROTOCOL_VERSION_KEY, SSLSupport.REQUESTED_PROTOCOL_VERSIONS_KEY, - SSLSupport.REQUESTED_CIPHERS_KEY -> true; + Globals.KEY_SIZE_ATTR, Globals.SSL_SESSION_ID_ATTR, Globals.SSL_SESSION_MGR_ATTR, + SSLSupport.PROTOCOL_VERSION_KEY, SSLSupport.REQUESTED_PROTOCOL_VERSIONS_KEY, + SSLSupport.REQUESTED_CIPHERS_KEY -> + true; default -> false; }; } 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 15e93f4007..66bf2ac424 100644 --- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java +++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java @@ -1675,7 +1675,6 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access } - /** * Write identifier element %{xxx}L */ @@ -1705,7 +1704,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/CrawlerSessionManagerValve.java b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java index 5264f67881..0c3eaca627 100644 --- a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java +++ b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java @@ -275,8 +275,8 @@ public class CrawlerSessionManagerValve extends ValveBase { return result.toString(); } - private record CrawlerHttpSessionBindingListener(Map<String, String> clientIdSessionId, - String clientIdentifier) implements HttpSessionBindingListener, Serializable { + private record CrawlerHttpSessionBindingListener(Map<String,String> clientIdSessionId, String clientIdentifier) + implements HttpSessionBindingListener, Serializable { @Serial private static final long serialVersionUID = 1L; diff --git a/java/org/apache/catalina/valves/ErrorReportValve.java b/java/org/apache/catalina/valves/ErrorReportValve.java index 20ed3efe88..81f1296ede 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 fc689005cd..72f73a263f 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/FilterValve.java b/java/org/apache/catalina/valves/FilterValve.java index 6081bd58af..0a0f62e469 100644 --- a/java/org/apache/catalina/valves/FilterValve.java +++ b/java/org/apache/catalina/valves/FilterValve.java @@ -182,8 +182,7 @@ public class FilterValve extends ValveBase implements FilterConfig { ScheduledThreadPoolExecutor.class.getName().equals(args[0])) { return executor; } else { - throw new UnsupportedOperationException( - sm.getString("filterValve.proxyServletContext")); + throw new UnsupportedOperationException(sm.getString("filterValve.proxyServletContext")); } }); } diff --git a/java/org/apache/catalina/valves/JsonErrorReportValve.java b/java/org/apache/catalina/valves/JsonErrorReportValve.java index 10e308d785..1e6cdb2502 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 903a9d9112..f005a8234a 100644 --- a/java/org/apache/catalina/valves/RemoteIpValve.java +++ b/java/org/apache/catalina/valves/RemoteIpValve.java @@ -383,14 +383,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 7d03facc83..59bc45686a 100644 --- a/java/org/apache/catalina/valves/rewrite/QuotedStringTokenizer.java +++ b/java/org/apache/catalina/valves/rewrite/QuotedStringTokenizer.java @@ -71,9 +71,8 @@ public class QuotedStringTokenizer { currentMode = WordMode.SPACES; } } - default -> - throw new IllegalStateException(sm.getString("quotedStringTokenizer.tokenizeError", inputText, - Integer.valueOf(pos), currentMode)); + default -> throw new IllegalStateException(sm.getString("quotedStringTokenizer.tokenizeError", + inputText, 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 b76d2b6c05..68dfd8feea 100644 --- a/java/org/apache/catalina/valves/rewrite/RewriteValve.java +++ b/java/org/apache/catalina/valves/rewrite/RewriteValve.java @@ -252,7 +252,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]" : "")); } @@ -536,7 +536,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/catalina/webresources/DirResourceSet.java b/java/org/apache/catalina/webresources/DirResourceSet.java index 83eacf7ad0..2e43408402 100644 --- a/java/org/apache/catalina/webresources/DirResourceSet.java +++ b/java/org/apache/catalina/webresources/DirResourceSet.java @@ -377,7 +377,6 @@ public class DirResourceSet extends AbstractFileResourceSet implements WebResour } - @Override public ReadWriteLock getLock(String path) { String key = getLockKey(path); diff --git a/java/org/apache/coyote/CompressionConfig.java b/java/org/apache/coyote/CompressionConfig.java index 631f74f075..c48dee1b13 100644 --- a/java/org/apache/coyote/CompressionConfig.java +++ b/java/org/apache/coyote/CompressionConfig.java @@ -210,9 +210,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 8e9dc48f51..07cad56956 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/UpgradeToken.java b/java/org/apache/coyote/UpgradeToken.java index b77cf25c5a..d034763c62 100644 --- a/java/org/apache/coyote/UpgradeToken.java +++ b/java/org/apache/coyote/UpgradeToken.java @@ -31,7 +31,7 @@ import org.apache.tomcat.InstanceManager; * @param protocol The desired protocol to upgrade to */ public record UpgradeToken(HttpUpgradeHandler httpUpgradeHandler, ContextBind contextBind, - InstanceManager instanceManager, String protocol) { + InstanceManager instanceManager, String protocol) { public ContextBind getContextBind() { return contextBind; diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java b/java/org/apache/coyote/ajp/AjpProcessor.java index f989e49cd1..8bb55ecffb 100644 --- a/java/org/apache/coyote/ajp/AjpProcessor.java +++ b/java/org/apache/coyote/ajp/AjpProcessor.java @@ -1039,9 +1039,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 f80ddd15fb..0219c037a4 100644 --- a/java/org/apache/el/lang/ELSupport.java +++ b/java/org/apache/el/lang/ELSupport.java @@ -177,8 +177,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, @@ -227,8 +227,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(); @@ -336,8 +335,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(); @@ -476,8 +474,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/el/util/ReflectionUtil.java b/java/org/apache/el/util/ReflectionUtil.java index e8936efaf5..583722454a 100644 --- a/java/org/apache/el/util/ReflectionUtil.java +++ b/java/org/apache/el/util/ReflectionUtil.java @@ -502,9 +502,8 @@ public class ReflectionUtil { /* * This class duplicates code in jakarta.el.Util. When making changes keep the code in sync. */ - private record MatchResult(boolean varArgs, int exactCount, int assignableCount, - int coercibleCount, int varArgsCount, - boolean bridge) implements Comparable<MatchResult> { + private record MatchResult(boolean varArgs, int exactCount, int assignableCount, int coercibleCount, + int varArgsCount, boolean bridge) implements Comparable<MatchResult> { @Override public int compareTo(MatchResult o) { @@ -540,8 +539,7 @@ public class ReflectionUtil { ((MatchResult) o).assignableCount() == this.assignableCount() && ((MatchResult) o).coercibleCount() == this.coercibleCount() && ((MatchResult) o).varArgsCount() == this.varArgsCount() && - ((MatchResult) o).varArgs() == this.varArgs() && - ((MatchResult) o).bridge() == this.bridge()); + ((MatchResult) o).varArgs() == this.varArgs() && ((MatchResult) o).bridge() == this.bridge()); } @Override 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 f85ef8e4fb..4797eab21d 100644 --- a/java/org/apache/jasper/compiler/ELFunctionMapper.java +++ b/java/org/apache/jasper/compiler/ELFunctionMapper.java @@ -187,7 +187,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 d0f0ccacdf..732991aaa2 100644 --- a/java/org/apache/jasper/compiler/Generator.java +++ b/java/org/apache/jasper/compiler/Generator.java @@ -1744,7 +1744,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); @@ -3038,73 +3038,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; @@ -3133,13 +3128,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(); @@ -3147,12 +3142,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(); @@ -3166,46 +3160,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 1f58e4aa74..6b8586381d 100644 --- a/java/org/apache/jasper/compiler/JspDocumentParser.java +++ b/java/org/apache/jasper/compiler/JspDocumentParser.java @@ -362,8 +362,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 * @@ -741,7 +741,8 @@ class JspDocumentParser extends DefaultHandler2 implements TagConstants { } } case INCLUDE_DIRECTIVE_ACTION -> { - node = new Node.IncludeDirective(qName, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, current); + node = new Node.IncludeDirective(qName, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, + current); processIncludeDirective(nonTaglibAttrs.getValue("file"), node); } case DECLARATION_ACTION -> { @@ -788,7 +789,8 @@ class JspDocumentParser extends DefaultHandler2 implements TagConstants { node = new Node.JspOutput(qName, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, current); case TAG_DIRECTIVE_ACTION -> { if (!isTagFile) { - throw new SAXParseException(Localizer.getMessage("jsp.error.action.isnottagfile", localName), locator); + throw new SAXParseException(Localizer.getMessage("jsp.error.action.isnottagfile", localName), + locator); } node = new Node.TagDirective(qName, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, current); String imports = nonTaglibAttrs.getValue("import"); @@ -799,32 +801,38 @@ class JspDocumentParser extends DefaultHandler2 implements TagConstants { } case ATTRIBUTE_DIRECTIVE_ACTION -> { if (!isTagFile) { - throw new SAXParseException(Localizer.getMessage("jsp.error.action.isnottagfile", localName), locator); + throw new SAXParseException(Localizer.getMessage("jsp.error.action.isnottagfile", localName), + locator); } - node = new Node.AttributeDirective(qName, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, current); + node = new Node.AttributeDirective(qName, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, + current); } case VARIABLE_DIRECTIVE_ACTION -> { if (!isTagFile) { - throw new SAXParseException(Localizer.getMessage("jsp.error.action.isnottagfile", localName), locator); + throw new SAXParseException(Localizer.getMessage("jsp.error.action.isnottagfile", localName), + locator); } - node = new Node.VariableDirective(qName, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, current); + node = new Node.VariableDirective(qName, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, + current); } case INVOKE_ACTION -> { if (!isTagFile) { - throw new SAXParseException(Localizer.getMessage("jsp.error.action.isnottagfile", localName), locator); + throw new SAXParseException(Localizer.getMessage("jsp.error.action.isnottagfile", localName), + locator); } node = new Node.InvokeAction(qName, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, current); } case DOBODY_ACTION -> { if (!isTagFile) { - throw new SAXParseException(Localizer.getMessage("jsp.error.action.isnottagfile", localName), locator); + throw new SAXParseException(Localizer.getMessage("jsp.error.action.isnottagfile", localName), + locator); } node = new Node.DoBodyAction(qName, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, current); } case ELEMENT_ACTION -> node = new Node.JspElement(qName, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, current); - default -> - throw new SAXParseException(Localizer.getMessage("jsp.error.xml.badStandardAction", localName), locator); + default -> throw new SAXParseException(Localizer.getMessage("jsp.error.xml.badStandardAction", localName), + locator); } return node; 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 988433494f..5de2e6ec07 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 */ @@ -1507,7 +1507,7 @@ public abstract class Node implements TagConstants { case VariableInfo.AT_END -> this.atEndScriptingVars; case VariableInfo.NESTED -> this.nestedScriptingVars; default -> throw new IllegalArgumentException( - Localizer.getMessage("jsp.error.page.invalid.varscope", Integer.valueOf(scope))); + Localizer.getMessage("jsp.error.page.invalid.varscope", Integer.valueOf(scope))); }; } diff --git a/java/org/apache/jasper/compiler/Parser.java b/java/org/apache/jasper/compiler/Parser.java index eb8eefbaeb..21a0b400c6 100644 --- a/java/org/apache/jasper/compiler/Parser.java +++ b/java/org/apache/jasper/compiler/Parser.java @@ -245,8 +245,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 96725d4a45..01abadb7b1 100644 --- a/java/org/apache/jasper/compiler/Validator.java +++ b/java/org/apache/jasper/compiler/Validator.java @@ -962,7 +962,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 e797ccf292..2f6461dc31 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); @@ -963,9 +963,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 f43da63928..b17025a75c 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 f9559faa95..38050c7bb7 100644 --- a/java/org/apache/jasper/servlet/JspServlet.java +++ b/java/org/apache/jasper/servlet/JspServlet.java @@ -41,10 +41,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 de2716b826..3790770f9a 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. @@ -563,8 +563,8 @@ public class JspServletWrapper { throw new JasperException(ex); } - JavacErrorDetail detail = new JavacErrorDetail(jspFrame.getMethodName(), javaLineNumber, - source.fileName(), source.lineNumber(), null, ctxt); + JavacErrorDetail detail = new JavacErrorDetail(jspFrame.getMethodName(), javaLineNumber, source.fileName(), + source.lineNumber(), null, ctxt); if (options.getDisplaySourceFragment()) { return new JasperException( 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 d7eb5ea35b..489a7909c1 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