This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 6df9585638 Re-apply standard formatting
6df9585638 is described below
commit 6df958563875e62b09e883164d141a3d141351b1
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Aug 21 18:12:13 2026 +0100
Re-apply standard formatting
---
java/org/apache/catalina/Store.java | 6 ++--
java/org/apache/catalina/session/ManagerBase.java | 16 ++++++---
.../catalina/valves/AbstractAccessLogValve.java | 42 +++++++++++-----------
.../valves/CrawlerSessionManagerValve.java | 3 ++
.../apache/catalina/valves/ErrorReportValve.java | 4 +--
.../catalina/valves/ExtendedAccessLogValve.java | 15 ++++++++
.../catalina/valves/JsonErrorReportValve.java | 7 ++--
.../apache/catalina/valves/PersistentValve.java | 11 +++---
.../catalina/valves/ProxyErrorReportValve.java | 8 ++---
java/org/apache/catalina/valves/SSLValve.java | 3 +-
.../catalina/valves/StuckThreadDetectionValve.java | 3 +-
11 files changed, 71 insertions(+), 47 deletions(-)
diff --git a/java/org/apache/catalina/Store.java b/java/org/apache/catalina/Store.java
index 095df95c9a..c2cb99c572 100644
--- a/java/org/apache/catalina/Store.java
+++ b/java/org/apache/catalina/Store.java
@@ -48,6 +48,7 @@ public interface Store {
* Return the number of Sessions present in this Store.
*
* @return the number of Sessions
+ *
* @exception IOException if an input/output error occurs
*/
int getSize() throws IOException;
@@ -62,10 +63,11 @@ public interface Store {
/**
- * Return an array containing the session identifiers of all Sessions currently saved in this Store. If there are
- * no such Sessions, a zero-length array is returned.
+ * Return an array containing the session identifiers of all Sessions currently saved in this Store. If there are no
+ * such Sessions, a zero-length array is returned.
*
* @return the session identifiers
+ *
* @exception IOException if an input/output error occurred
*/
String[] keys() throws IOException;
diff --git a/java/org/apache/catalina/session/ManagerBase.java b/java/org/apache/catalina/session/ManagerBase.java
index 84b5869bff..54760be004 100644
--- a/java/org/apache/catalina/session/ManagerBase.java
+++ b/java/org/apache/catalina/session/ManagerBase.java
@@ -419,8 +419,8 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
sessionIdGenerator = sessionIdGeneratorClass.getConstructor().newInstance();
return sessionIdGenerator;
} catch (ReflectiveOperationException ex) {
- log.warn(sm.getString("managerBase.sessionIdGeneratorInitFailed",
- sessionIdGeneratorClass.getName()), ex);
+ log.warn(sm.getString("managerBase.sessionIdGeneratorInitFailed", sessionIdGeneratorClass.getName()),
+ ex);
}
}
return null;
@@ -856,9 +856,9 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
/**
* Change the session ID.
*
- * @param session The session
- * @param newId The new session ID
- * @param notifySessionListeners Whether to notify session listeners
+ * @param session The session
+ * @param newId The new session ID
+ * @param notifySessionListeners Whether to notify session listeners
* @param notifyContainerListeners Whether to notify container listeners
*/
protected void changeSessionId(Session session, String newId, boolean notifySessionListeners,
@@ -1270,6 +1270,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
* Get the timestamp of the last access for the given session.
*
* @param sessionId The session ID
+ *
* @return the timestamp or -1 if not found
*/
public long getThisAccessedTimestamp(String sessionId) {
@@ -1287,6 +1288,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
* Get the last access time for the given session as a formatted string.
*
* @param sessionId The session ID
+ *
* @return the formatted time or empty string if not found
*/
public String getThisAccessedTime(String sessionId) {
@@ -1304,6 +1306,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
* Get the timestamp of the last access for the given session.
*
* @param sessionId The session ID
+ *
* @return the timestamp or -1 if not found
*/
public long getLastAccessedTimestamp(String sessionId) {
@@ -1321,6 +1324,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
* Get the last access time for the given session as a formatted string.
*
* @param sessionId The session ID
+ *
* @return the formatted time or empty string if not found
*/
public String getLastAccessedTime(String sessionId) {
@@ -1338,6 +1342,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
* Get the creation time for the given session as a formatted string.
*
* @param sessionId The session ID
+ *
* @return the formatted time or empty string if not found
*/
public String getCreationTime(String sessionId) {
@@ -1355,6 +1360,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
* Get the creation timestamp for the given session.
*
* @param sessionId The session ID
+ *
* @return the timestamp or -1 if not found
*/
public long getCreationTimestamp(String sessionId) {
diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 3f88bbb3d9..02ad0b310e 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -301,7 +301,7 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access
* Creates a new cache with the given format, locale and parent cache.
*
* @param format The format string
- * @param loc The locale
+ * @param loc The locale
* @param parent The parent cache
*/
private Cache(String format, Locale loc, Cache parent) {
@@ -413,8 +413,8 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access
/**
* Creates a new date format cache.
*
- * @param size The cache size
- * @param loc The default locale
+ * @param size The cache size
+ * @param loc The default locale
* @param parentFC The parent cache
*/
protected DateFormatCache(int size, Locale loc, DateFormatCache parentFC) {
@@ -434,7 +434,7 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access
* Gets the cache for the given format.
*
* @param format The format string
- * @param loc The locale
+ * @param loc The locale
*
* @return The cache
*/
@@ -473,8 +473,8 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access
* Gets the formatted timestamp in the given format.
*
* @param format The format string
- * @param loc The locale
- * @param time The time in milliseconds
+ * @param loc The locale
+ * @param time The time in milliseconds
*
* @return The formatted timestamp
*/
@@ -507,8 +507,8 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access
protected String condition = null;
/**
- * Are we doing conditional logging ? default null. It is the value of <code>conditionIf</code> property.
- * If the ServletRequest.getAttribute(conditionIf) yields a non-null value, the logging will be performed.
+ * Are we doing conditional logging ? default null. It is the value of <code>conditionIf</code> property. If the
+ * ServletRequest.getAttribute(conditionIf) yields a non-null value, the logging will be performed.
*/
protected String conditionIf = null;
@@ -1652,14 +1652,14 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access
/**
* Appends the query string to the buffer with optional formatting.
*
- * @param query The query string to append
- * @param buf The buffer to which the query string should be appended
- * @param appendDelim Whether to prepend a '?' delimiter
- * @param escapeQuoteAsDouble Whether to escape quotes as double quotes
- * @param writeDashOnNull Whether to write "-" when query is null
- */
- protected static void appendQueryString(String query, CharArrayWriter buf,
- boolean appendDelim, boolean escapeQuoteAsDouble, boolean writeDashOnNull) {
+ * @param query The query string to append
+ * @param buf The buffer to which the query string should be appended
+ * @param appendDelim Whether to prepend a '?' delimiter
+ * @param escapeQuoteAsDouble Whether to escape quotes as double quotes
+ * @param writeDashOnNull Whether to write "-" when query is null
+ */
+ protected static void appendQueryString(String query, CharArrayWriter buf, boolean appendDelim,
+ boolean escapeQuoteAsDouble, boolean writeDashOnNull) {
if (query != null) {
if (appendDelim) {
buf.append('?');
@@ -2209,8 +2209,8 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access
* - %to trailer response header - %V server name per UseCanonicalName setting
*
* The following escaped elements are not escaped in Tomcat because values that would require escaping are rejected
- * before they reach the AccessLogValve: - %h remote host - %H request protocol - %m request method
- * - %v canonical server name
+ * before they reach the AccessLogValve: - %h remote host - %H request protocol - %m request method - %v canonical
+ * server name
*
* The following escaped elements are supported by Tomcat: - %{}i request header - %{}o response header - %u remote
* user
@@ -2242,9 +2242,9 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access
/**
* Escapes and appends the input string to the destination writer.
*
- * @param input The input string
- * @param dest The destination writer
- * @param escapeQuoteAsDouble Whether to escape quotes as double quotes
+ * @param input The input string
+ * @param dest The destination writer
+ * @param escapeQuoteAsDouble Whether to escape quotes as double quotes
*/
protected static void escapeAndAppend(String input, CharArrayWriter dest, boolean escapeQuoteAsDouble) {
if (input == null || input.isEmpty()) {
diff --git a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
index 856a6e9131..89a71b3be4 100644
--- a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
+++ b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
@@ -88,6 +88,7 @@ public class CrawlerSessionManagerValve extends ValveBase {
/**
* Get the regular expression used to identify crawlers based on the User-Agent header.
+ *
* @see #setCrawlerUserAgents(String)
*
* @return The current regular expression being used to match user agents
@@ -114,6 +115,7 @@ public class CrawlerSessionManagerValve extends ValveBase {
/**
* Get the regular expression used to identify crawlers based on their IP address.
+ *
* @see #setCrawlerIps(String)
*
* @return The current regular expression being used to match IP addresses
@@ -135,6 +137,7 @@ public class CrawlerSessionManagerValve extends ValveBase {
/**
* Get the session timeout for a crawler's session.
+ *
* @see #setSessionInactiveInterval(int)
*
* @return The current timeout in seconds
diff --git a/java/org/apache/catalina/valves/ErrorReportValve.java b/java/org/apache/catalina/valves/ErrorReportValve.java
index 3a33b39647..0cd75dfb9c 100644
--- a/java/org/apache/catalina/valves/ErrorReportValve.java
+++ b/java/org/apache/catalina/valves/ErrorReportValve.java
@@ -431,8 +431,8 @@ public class ErrorReportValve extends ValveBase {
/**
- * Sets a property for error page configuration. Properties starting with
- * "errorCode." or "exceptionType." are used to configure error pages.
+ * Sets a property for error page configuration. Properties starting with "errorCode." or "exceptionType." are used
+ * to configure error pages.
*
* @param name The property name
* @param value The property value
diff --git a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
index aa8e4c665b..76e7488ba9 100644
--- a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
+++ b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
@@ -456,6 +456,7 @@ public class ExtendedAccessLogValve extends AccessLogValve {
* Returns the next token from the pattern string.
*
* @return the next token, or {@code null} if no more tokens are available
+ *
* @throws IOException if an I/O error occurs
*/
public String getToken() throws IOException {
@@ -504,6 +505,7 @@ public class ExtendedAccessLogValve extends AccessLogValve {
* Returns the parameter value from the most recent parameter token.
*
* @return the parameter value, or {@code null} if no parameter is available
+ *
* @throws IOException if an I/O error occurs
*/
public String getParameter() throws IOException {
@@ -529,6 +531,7 @@ public class ExtendedAccessLogValve extends AccessLogValve {
* Returns any whitespace following the current position.
*
* @return the whitespace characters, or an empty string if none
+ *
* @throws IOException if an I/O error occurs
*/
public String getWhiteSpaces() throws IOException {
@@ -566,6 +569,7 @@ public class ExtendedAccessLogValve extends AccessLogValve {
* Returns the remaining unparsed portion of the pattern string.
*
* @return the remaining characters in the pattern
+ *
* @throws IOException if an I/O error occurs
*/
public String getRemains() throws IOException {
@@ -630,7 +634,9 @@ public class ExtendedAccessLogValve extends AccessLogValve {
*
* @param token the pattern token
* @param tokenizer the pattern tokenizer
+ *
* @return the log element, or {@code null} if the token is unrecognized
+ *
* @throws IOException if an I/O error occurs while reading the pattern
*/
protected AccessLogElement getLogElement(String token, PatternTokenizer tokenizer) throws IOException {
@@ -694,7 +700,9 @@ public class ExtendedAccessLogValve extends AccessLogValve {
* Returns the appropriate log element for a client-to-server token.
*
* @param tokenizer the pattern tokenizer
+ *
* @return the log element, or {@code null} if unrecognized
+ *
* @throws IOException if an I/O error occurs while reading the pattern
*/
protected AccessLogElement getClientToServerElement(PatternTokenizer tokenizer) throws IOException {
@@ -751,7 +759,9 @@ public class ExtendedAccessLogValve extends AccessLogValve {
* Returns the appropriate log element for a server-to-client token.
*
* @param tokenizer the pattern tokenizer
+ *
* @return the log element, or {@code null} if unrecognized
+ *
* @throws IOException if an I/O error occurs while reading the pattern
*/
protected AccessLogElement getServerToClientElement(PatternTokenizer tokenizer) throws IOException {
@@ -778,7 +788,9 @@ public class ExtendedAccessLogValve extends AccessLogValve {
* Returns the appropriate log element for a proxy token.
*
* @param tokenizer the pattern tokenizer
+ *
* @return the log element, or {@code null} if unrecognized
+ *
* @throws IOException if an I/O error occurs while reading the pattern
*/
protected AccessLogElement getProxyElement(PatternTokenizer tokenizer) throws IOException {
@@ -797,7 +809,9 @@ public class ExtendedAccessLogValve extends AccessLogValve {
* Returns the appropriate log element for an x-parameter token.
*
* @param tokenizer the pattern tokenizer
+ *
* @return the log element, or {@code null} if unrecognized
+ *
* @throws IOException if an I/O error occurs while reading the pattern
*/
protected AccessLogElement getXParameterElement(PatternTokenizer tokenizer) throws IOException {
@@ -842,6 +856,7 @@ public class ExtendedAccessLogValve extends AccessLogValve {
* Returns the appropriate log element for a servlet request method parameter.
*
* @param parameter the parameter name mapping to a request method
+ *
* @return the log element, or {@code null} if the parameter is unrecognized
*/
protected AccessLogElement getServletRequestElement(String parameter) {
diff --git a/java/org/apache/catalina/valves/JsonErrorReportValve.java b/java/org/apache/catalina/valves/JsonErrorReportValve.java
index e023267dff..3e9ebeb6cb 100644
--- a/java/org/apache/catalina/valves/JsonErrorReportValve.java
+++ b/java/org/apache/catalina/valves/JsonErrorReportValve.java
@@ -121,8 +121,7 @@ public class JsonErrorReportValve extends ErrorReportValve {
StackTraceElement[] elements = throwable.getStackTrace();
int pos = elements.length;
for (int i = elements.length - 1; i >= 0; i--) {
- if (elements[i].getClassName()
- .startsWith("org.apache.catalina.core.ApplicationFilterChain") &&
+ if (elements[i].getClassName().startsWith("org.apache.catalina.core.ApplicationFilterChain") &&
elements[i].getMethodName().equals("internalDoFilter")) {
pos = i;
break;
@@ -130,8 +129,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/PersistentValve.java b/java/org/apache/catalina/valves/PersistentValve.java
index cd699778bb..d50a73968d 100644
--- a/java/org/apache/catalina/valves/PersistentValve.java
+++ b/java/org/apache/catalina/valves/PersistentValve.java
@@ -51,8 +51,7 @@ import org.apache.juli.logging.LogFactory;
* <p>
* To avoid conflicts and/or errors when updating the session store, each session must only be accessed by no more than
* one concurrent request. The {@code filter} field can be used to define requests (e.g. those for static resources)
- * that do not need access to the session and can bypass the session load/save functionality
- * provided by this Valve.
+ * that do not need access to the session and can bypass the session load/save functionality provided by this Valve.
* <p>
* The Valve uses a per session {@code Semaphore} to ensure that each session is accessed by no more than one request at
* a time within a single Tomcat instance. The behaviour if multiple requests try to access the session concurrently can
@@ -148,8 +147,8 @@ public class PersistentValve extends ValveBase {
* Acquire the per session semaphore.
*/
if (sessionId != null) {
- semaphore = sessionToSemaphoreMap.compute(sessionId,
- (k, v) -> v == null ? new UsageCountingSemaphore(semaphoreFairness) : v.incrementUsageCount());
+ semaphore = sessionToSemaphoreMap.compute(sessionId, (k,
+ v) -> v == null ? new UsageCountingSemaphore(semaphoreFairness) : v.incrementUsageCount());
if (semaphoreBlockOnAcquire) {
if (semaphoreAcquireUninterruptibly) {
semaphore.acquireUninterruptibly();
@@ -227,8 +226,8 @@ public class PersistentValve extends ValveBase {
*/
if (!asyncOnEntry) {
AsyncContext asyncContext = request.getAsyncContext();
- asyncContext.addListener(
- new StoreSessionAsyncListener(request, context, sessionId, semaphore, mustReleaseSemaphore));
+ asyncContext.addListener(new StoreSessionAsyncListener(request, context, sessionId, semaphore,
+ mustReleaseSemaphore));
}
} else {
storeSession(request, context, sessionId, semaphore, mustReleaseSemaphore);
diff --git a/java/org/apache/catalina/valves/ProxyErrorReportValve.java b/java/org/apache/catalina/valves/ProxyErrorReportValve.java
index a2c34a36ac..256467f106 100644
--- a/java/org/apache/catalina/valves/ProxyErrorReportValve.java
+++ b/java/org/apache/catalina/valves/ProxyErrorReportValve.java
@@ -124,8 +124,8 @@ public class ProxyErrorReportValve extends ErrorReportValve {
/**
* Reports the error by redirecting or proxying to the configured error URL.
*
- * @param request the servlet request
- * @param response the servlet response
+ * @param request the servlet request
+ * @param response the servlet response
* @param throwable the exception that caused the error, or {@code null}
*/
@Override
@@ -176,8 +176,8 @@ public class ProxyErrorReportValve extends ErrorReportValve {
}
try {
stringBuilder.append("requestUri=");
- stringBuilder.append(
- URLEncoder.encode(request.getDecodedRequestURI(), request.getConnector().getURIEncoding()));
+ stringBuilder
+ .append(URLEncoder.encode(request.getDecodedRequestURI(), request.getConnector().getURIEncoding()));
stringBuilder.append("&statusCode=");
stringBuilder.append(URLEncoder.encode(String.valueOf(statusCode), "UTF-8"));
} catch (UnsupportedEncodingException e) {
diff --git a/java/org/apache/catalina/valves/SSLValve.java b/java/org/apache/catalina/valves/SSLValve.java
index 3470642b40..0f0d5843aa 100644
--- a/java/org/apache/catalina/valves/SSLValve.java
+++ b/java/org/apache/catalina/valves/SSLValve.java
@@ -175,7 +175,8 @@ public class SSLValve extends ValveBase {
* Retrieves the value of the specified header from the request, handling null and "(null)" values.
*
* @param request The request object
- * @param header The header name to retrieve
+ * @param header The header name to retrieve
+ *
* @return The header value, or null if not present or equal to "(null)"
*/
public String mygetHeader(Request request, String header) {
diff --git a/java/org/apache/catalina/valves/StuckThreadDetectionValve.java b/java/org/apache/catalina/valves/StuckThreadDetectionValve.java
index eb14a32241..ea00675c1c 100644
--- a/java/org/apache/catalina/valves/StuckThreadDetectionValve.java
+++ b/java/org/apache/catalina/valves/StuckThreadDetectionValve.java
@@ -276,8 +276,7 @@ public class StuckThreadDetectionValve extends ValveBase {
}
/**
- * Returns the total number of threads that have been interrupted
- * due to being stuck.
+ * Returns the total number of threads that have been interrupted due to being stuck.
*
* @return the count of interrupted threads
*/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.