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 a5ee28c5c9 Re-apply standard formatting a5ee28c5c9 is described below commit a5ee28c5c9fb0ae22007f158a88aba58ef28f39d Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Feb 7 14:26:56 2025 +0000 Re-apply standard formatting --- java/jakarta/servlet/http/Cookie.java | 2 +- java/org/apache/catalina/WebResourceRoot.java | 2 +- java/org/apache/catalina/connector/Request.java | 2 +- .../catalina/servlets/DataSourcePropertyStore.java | 9 +++-- .../apache/catalina/servlets/DefaultServlet.java | 2 +- .../apache/catalina/servlets/WebdavServlet.java | 8 ++--- .../apache/catalina/session/DataSourceStore.java | 3 +- java/org/apache/catalina/util/RateLimiter.java | 2 +- .../apache/catalina/valves/JDBCAccessLogValve.java | 2 ++ .../catalina/valves/ParameterLimitValve.java | 38 ++++++++++++---------- java/org/apache/coyote/NonPipeliningProcessor.java | 4 +-- java/org/apache/el/util/Validation.java | 2 +- 12 files changed, 41 insertions(+), 35 deletions(-) diff --git a/java/jakarta/servlet/http/Cookie.java b/java/jakarta/servlet/http/Cookie.java index 20ec7a741b..8a659684d4 100644 --- a/java/jakarta/servlet/http/Cookie.java +++ b/java/jakarta/servlet/http/Cookie.java @@ -235,7 +235,7 @@ public class Cookie implements Cloneable, Serializable { * The default value is <code>false</code>. * * @param secure if <code>true</code>, sends the cookie from the browser to the server only when using a secure - * protocol; if <code>false</code>, sent on any protocol + * protocol; if <code>false</code>, sent on any protocol * * @see #getSecure */ diff --git a/java/org/apache/catalina/WebResourceRoot.java b/java/org/apache/catalina/WebResourceRoot.java index f96dc7d7e8..b99874ee3f 100644 --- a/java/org/apache/catalina/WebResourceRoot.java +++ b/java/org/apache/catalina/WebResourceRoot.java @@ -425,7 +425,7 @@ public interface WebResourceRoot extends Lifecycle { /** * @return {@code true} if the main resources are read only, otherwise {@code false}. The default implementation - * returns {@code false}. + * returns {@code false}. */ default boolean isReadOnly() { return false; diff --git a/java/org/apache/catalina/connector/Request.java b/java/org/apache/catalina/connector/Request.java index 0dfc63019d..a6b0beb7ed 100644 --- a/java/org/apache/catalina/connector/Request.java +++ b/java/org/apache/catalina/connector/Request.java @@ -448,7 +448,7 @@ public class Request implements HttpServletRequest { userPrincipal = null; subject = null; parametersParsed = false; - if (connector != null ) { + if (connector != null) { maxParameterCount = connector.getMaxParameterCount(); } else { maxParameterCount = -1; diff --git a/java/org/apache/catalina/servlets/DataSourcePropertyStore.java b/java/org/apache/catalina/servlets/DataSourcePropertyStore.java index bbb2cf3515..fd700dfc51 100644 --- a/java/org/apache/catalina/servlets/DataSourcePropertyStore.java +++ b/java/org/apache/catalina/servlets/DataSourcePropertyStore.java @@ -52,8 +52,7 @@ import org.w3c.dom.Node; * </ul> * The table name used can be configured using the <code>tableName</code> property of the store. * <p> - * Example table schema: - * <code>CREATE TABLE properties ( + * Example table schema: <code>CREATE TABLE properties ( * path VARCHAR(1024) NOT NULL, * namespace VARCHAR(64) NOT NULL, * name VARCHAR(64) NOT NULL, @@ -97,8 +96,7 @@ public class DataSourcePropertyStore implements WebdavServlet.PropertyStore { } /** - * @param dataSourceName the DataSource JNDI name, will be prefixed with - * java:comp/env for the lookup. + * @param dataSourceName the DataSource JNDI name, will be prefixed with java:comp/env for the lookup. */ public void setDataSourceName(String dataSourceName) { this.dataSourceName = dataSourceName; @@ -129,7 +127,8 @@ public class DataSourcePropertyStore implements WebdavServlet.PropertyStore { try { dataSource = (DataSource) ((new InitialContext()).lookup("java:comp/env/" + dataSourceName)); } catch (NamingException e) { - throw new IllegalArgumentException(sm.getString("webdavservlet.dataSourceStore.noDataSource", dataSourceName), e); + throw new IllegalArgumentException( + sm.getString("webdavservlet.dataSourceStore.noDataSource", dataSourceName), e); } } addPropertyStatement = "INSERT INTO " + tableName + " (path, namespace, name, node) VALUES (?, ?, ?, ?)"; diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java b/java/org/apache/catalina/servlets/DefaultServlet.java index 771ba538aa..9ba87003cd 100644 --- a/java/org/apache/catalina/servlets/DefaultServlet.java +++ b/java/org/apache/catalina/servlets/DefaultServlet.java @@ -1516,7 +1516,7 @@ public class DefaultServlet extends HttpServlet { if (response.isCommitted()) { /* * Ideally, checkIfRange() would be changed to return Boolean so the three states (satisfied, - * unsatisfied and error) could each be communicated via the return value. There isn't a backwards + * unsatisfied and error) could each be communicated via the return value. There isn't a backwards * compatible way to do that that doesn't involve changing the method name and there are benefits to * retaining the consistency of the existing method name pattern. Hence, this 'trick'. For the error * state, checkIfRange() will call response.sendError() which will commit the response which this method diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java b/java/org/apache/catalina/servlets/WebdavServlet.java index 11ebb5b7a7..1553ee58a5 100644 --- a/java/org/apache/catalina/servlets/WebdavServlet.java +++ b/java/org/apache/catalina/servlets/WebdavServlet.java @@ -86,8 +86,8 @@ import org.xml.sax.SAXException; * users and WebDAV users, the WebDAV servlet may be mounted at a sub-path (e.g. <code>/webdav/*</code>) which creates * an additional mapping for the entire web application under that sub-path, with WebDAV access to all the resources. * <p> - * By default, the <code>WEB-INF</code> and <code>META-INF</code> directories are not accessible via WebDAV. This may - * be changed by setting the <code>allowSpecialPaths</code> initialisation parameter to <code>true</code>. + * By default, the <code>WEB-INF</code> and <code>META-INF</code> directories are not accessible via WebDAV. This may be + * changed by setting the <code>allowSpecialPaths</code> initialisation parameter to <code>true</code>. * <p> * It is also possible to enable WebDAV access to a sub-set of the standard web application URL space rather than * creating an additional, WebDAV specific mapping. To do this, map the WebDAV servlet to the desired sub-path and set @@ -1860,8 +1860,8 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen private boolean isSpecialPath(final String path) { if (!allowSpecialPaths) { String upperCasePath = path.toUpperCase(Locale.ENGLISH); - if (upperCasePath.startsWith("/WEB-INF/") || upperCasePath.startsWith("/META-INF/") - || upperCasePath.equals("/WEB-INF") || upperCasePath.equals("/META-INF")) { + if (upperCasePath.startsWith("/WEB-INF/") || upperCasePath.startsWith("/META-INF/") || + upperCasePath.equals("/WEB-INF") || upperCasePath.equals("/META-INF")) { return true; } } diff --git a/java/org/apache/catalina/session/DataSourceStore.java b/java/org/apache/catalina/session/DataSourceStore.java index 3484227e8f..54971e2541 100644 --- a/java/org/apache/catalina/session/DataSourceStore.java +++ b/java/org/apache/catalina/session/DataSourceStore.java @@ -648,7 +648,8 @@ public class DataSourceStore extends StoreBase { Context envCtx = (Context) (new InitialContext()).lookup("java:comp/env"); this.dataSource = (DataSource) envCtx.lookup(this.dataSourceName); } catch (NamingException e) { - context.getLogger().error(sm.getString("dataSourceStore.wrongDataSource", this.dataSourceName), e); + context.getLogger().error(sm.getString("dataSourceStore.wrongDataSource", this.dataSourceName), + e); } } } diff --git a/java/org/apache/catalina/util/RateLimiter.java b/java/org/apache/catalina/util/RateLimiter.java index d1beb65399..bdd8b27736 100644 --- a/java/org/apache/catalina/util/RateLimiter.java +++ b/java/org/apache/catalina/util/RateLimiter.java @@ -92,7 +92,7 @@ public interface RateLimiter { /** * Provide the quota header for this rate limit for a given request count within the current time window. * - * @param requestCount The request count within the current time window + * @param requestCount The request count within the current time window * * @return the quota header for the given value of request count * diff --git a/java/org/apache/catalina/valves/JDBCAccessLogValve.java b/java/org/apache/catalina/valves/JDBCAccessLogValve.java index c598759874..c4fef50108 100644 --- a/java/org/apache/catalina/valves/JDBCAccessLogValve.java +++ b/java/org/apache/catalina/valves/JDBCAccessLogValve.java @@ -98,6 +98,7 @@ import org.apache.tomcat.util.ExceptionUtils; * * @author Andre de Jesus * @author Peter Rossbach + * * @deprecated Non scalable design, and not documented. Will be removed in Tomcat 12. */ @Deprecated @@ -577,6 +578,7 @@ public class JDBCAccessLogValve extends ValveBase implements AccessLog { /** * Prepare tables for processing. Used by subclasses for testing. + * * @throws SQLException if an exception occurs */ protected void prepare() throws SQLException { diff --git a/java/org/apache/catalina/valves/ParameterLimitValve.java b/java/org/apache/catalina/valves/ParameterLimitValve.java index add411e3fd..67fb456ee0 100644 --- a/java/org/apache/catalina/valves/ParameterLimitValve.java +++ b/java/org/apache/catalina/valves/ParameterLimitValve.java @@ -40,25 +40,26 @@ import org.apache.tomcat.util.file.ConfigurationSource; /** - * This is a concrete implementation of {@link ValveBase} that enforces a limit on the number of HTTP request parameters. - * The features of this implementation include: + * This is a concrete implementation of {@link ValveBase} that enforces a limit on the number of HTTP request + * parameters. The features of this implementation include: * <ul> * <li>URL-specific parameter limits that can be defined using regular expressions</li> * <li>Configurable through Tomcat's <code>server.xml</code> or <code>context.xml</code></li> - * <li> Requires a <code>parameter_limit.config</code> file containing the URL-specific parameter limits. - * It must be placed in the Host configuration folder or in the WEB-INF folder of the web application.</li> + * <li>Requires a <code>parameter_limit.config</code> file containing the URL-specific parameter limits. It must be + * placed in the Host configuration folder or in the WEB-INF folder of the web application.</li> * </ul> * <p> - * The default limit, specified by Connector's value, applies to all requests unless a more specific - * URL pattern is matched. URL patterns and their corresponding limits can be configured via a regular expression - * mapping through the <code>urlPatternLimits</code> attribute. + * The default limit, specified by Connector's value, applies to all requests unless a more specific URL pattern is + * matched. URL patterns and their corresponding limits can be configured via a regular expression mapping through the + * <code>urlPatternLimits</code> attribute. * </p> * <p> - * The Valve checks each incoming request and enforces the appropriate limit. If a request exceeds the allowed number - * of parameters, a <code>400 Bad Request</code> response is returned. + * The Valve checks each incoming request and enforces the appropriate limit. If a request exceeds the allowed number of + * parameters, a <code>400 Bad Request</code> response is returned. * </p> * <p> * Example, configuration in <code>context.xml</code>: + * * <pre> * {@code * <Context> @@ -67,6 +68,7 @@ import org.apache.tomcat.util.file.ConfigurationSource; * } * and in <code>parameter_limit.config</code>: * </pre> + * * <pre> * {@code * /api/.*=150 @@ -86,7 +88,7 @@ public class ParameterLimitValve extends ValveBase { /** * Map for URL-specific limits */ - protected Map<Pattern, Integer> urlPatternLimits = new ConcurrentHashMap<>(); + protected Map<Pattern,Integer> urlPatternLimits = new ConcurrentHashMap<>(); /** * Relative path to the configuration file. Note: If the valve's container is a context, this will be relative to @@ -154,7 +156,7 @@ public class ParameterLimitValve extends ValveBase { } try (InputStreamReader isr = new InputStreamReader(is, StandardCharsets.UTF_8); - BufferedReader reader = new BufferedReader(isr)) { + BufferedReader reader = new BufferedReader(isr)) { setUrlPatternLimits(reader); } catch (IOException ioe) { containerLog.error(sm.getString("parameterLimitValve.closeError"), ioe); @@ -174,10 +176,11 @@ public class ParameterLimitValve extends ValveBase { } /** - * Set the mapping of URL patterns to their corresponding parameter limits. - * The input should be provided line by line, where each line contains a pattern and a limit, separated by the last '='. + * Set the mapping of URL patterns to their corresponding parameter limits. The input should be provided line by + * line, where each line contains a pattern and a limit, separated by the last '='. * <p> * Example: + * * <pre> * /api/.*=50 * /api======/.*=150 @@ -185,7 +188,8 @@ public class ParameterLimitValve extends ValveBase { * # This is a comment * </pre> * - * @param reader A BufferedReader containing URL pattern to parameter limit mappings, with each pair on a separate line. + * @param reader A BufferedReader containing URL pattern to parameter limit mappings, with each pair on a separate + * line. */ public void setUrlPatternLimits(BufferedReader reader) { if (containerLog == null && getContainer() != null) { @@ -228,8 +232,8 @@ public class ParameterLimitValve extends ValveBase { } /** - * Checks if any of the defined patterns matches the URI of the request and if it does, - * enforces the corresponding parameter limit for the request. Then invoke the next Valve in the sequence. + * Checks if any of the defined patterns matches the URI of the request and if it does, enforces the corresponding + * parameter limit for the request. Then invoke the next Valve in the sequence. * * @param request The servlet request to be processed * @param response The servlet response to be created @@ -248,7 +252,7 @@ public class ParameterLimitValve extends ValveBase { String requestURI = context ? request.getRequestPathMB().toString() : request.getDecodedRequestURI(); // Iterate over the URL patterns and apply corresponding limits - for (Map.Entry<Pattern, Integer> entry : urlPatternLimits.entrySet()) { + for (Map.Entry<Pattern,Integer> entry : urlPatternLimits.entrySet()) { Pattern pattern = entry.getKey(); int limit = entry.getValue().intValue(); diff --git a/java/org/apache/coyote/NonPipeliningProcessor.java b/java/org/apache/coyote/NonPipeliningProcessor.java index 75a6da0830..a6e8759a57 100644 --- a/java/org/apache/coyote/NonPipeliningProcessor.java +++ b/java/org/apache/coyote/NonPipeliningProcessor.java @@ -18,8 +18,8 @@ package org.apache.coyote; /** * Marker interface used to indicate that the {@link Processor} does not implement pipe-lining of requests (e.g. - * HTTP/1.1 supports pipe-lining whereas HTTP/2 does not) which may enable some components to clear references sooner - * to aid GC. + * HTTP/1.1 supports pipe-lining whereas HTTP/2 does not) which may enable some components to clear references sooner to + * aid GC. */ public interface NonPipeliningProcessor extends Processor { diff --git a/java/org/apache/el/util/Validation.java b/java/org/apache/el/util/Validation.java index 498c9dda7d..2311122097 100644 --- a/java/org/apache/el/util/Validation.java +++ b/java/org/apache/el/util/Validation.java @@ -27,7 +27,7 @@ public class Validation { "false", "final", "finally", "float", "for", "goto", "if", "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch", "synchronized", "this", "throw", "throws", "transient", - "true", "try", "void", "volatile", "while"}; + "true", "try", "void", "volatile", "while" }; private static final boolean SKIP_IDENTIFIER_CHECK = Boolean.getBoolean("org.apache.el.parser.SKIP_IDENTIFIER_CHECK"); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org