This is an automated email from the ASF dual-hosted git repository.
markt 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 d809932100 Re-apply code formatting. No functional change.
d809932100 is described below
commit d809932100a34cc3eaa8ada000da474ac77891db
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Nov 22 22:11:44 2024 +0000
Re-apply code formatting. No functional change.
---
java/org/apache/catalina/WebResource.java | 4 +-
java/org/apache/catalina/connector/Response.java | 16 ++---
.../apache/catalina/connector/ResponseFacade.java | 16 ++---
.../catalina/loader/WebappClassLoaderBase.java | 6 +-
.../apache/catalina/manager/StatusTransformer.java | 44 ++++++--------
.../apache/catalina/servlets/WebdavServlet.java | 70 ++++++++++++----------
java/org/apache/catalina/startup/Catalina.java | 3 +-
7 files changed, 77 insertions(+), 82 deletions(-)
diff --git a/java/org/apache/catalina/WebResource.java
b/java/org/apache/catalina/WebResource.java
index db32461c53..7f046fd501 100644
--- a/java/org/apache/catalina/WebResource.java
+++ b/java/org/apache/catalina/WebResource.java
@@ -99,8 +99,8 @@ public interface WebResource {
String getETag();
/**
- * Return the strong ETag if available else return the weak ETag
calculated from the
- * content length and last modified.
+ * Return the strong ETag if available else return the weak ETag
calculated from the content length and last
+ * modified.
*
* @return The ETag for this resource
*/
diff --git a/java/org/apache/catalina/connector/Response.java
b/java/org/apache/catalina/connector/Response.java
index c79bb3b5a4..40c2601595 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -1141,10 +1141,10 @@ public class Response implements HttpServletResponse {
/**
* {@inheritDoc}
* <p>
- * Calling <code>sendError</code> with a status code of 103 differs from
the usual
- * behavior. Sending 103 will trigger the container to send a "103 Early
Hints" informational response including all
- * current headers. The application can continue to use the request and
response after calling sendError with a 103
- * status code, including triggering a more typical response of any type.
+ * Calling <code>sendError</code> with a status code of 103 differs from
the usual behavior. Sending 103 will
+ * trigger the container to send a "103 Early Hints" informational
response including all current headers. The
+ * application can continue to use the request and response after calling
sendError with a 103 status code,
+ * including triggering a more typical response of any type.
* <p>
* Starting with Tomcat 12, applications should use {@link
#sendEarlyHints}.
*/
@@ -1157,10 +1157,10 @@ public class Response implements HttpServletResponse {
/**
* {@inheritDoc}
* <p>
- * Calling <code>sendError</code> with a status code of 103 differs from
the usual
- * behavior. Sending 103 will trigger the container to send a "103 Early
Hints" informational response including all
- * current headers. The application can continue to use the request and
response after calling sendError with a 103
- * status code, including triggering a more typical response of any type.
+ * Calling <code>sendError</code> with a status code of 103 differs from
the usual behavior. Sending 103 will
+ * trigger the container to send a "103 Early Hints" informational
response including all current headers. The
+ * application can continue to use the request and response after calling
sendError with a 103 status code,
+ * including triggering a more typical response of any type.
* <p>
* Starting with Tomcat 12, applications should use {@link
#sendEarlyHints}.
*/
diff --git a/java/org/apache/catalina/connector/ResponseFacade.java
b/java/org/apache/catalina/connector/ResponseFacade.java
index dc53b090c3..4d01367bbd 100644
--- a/java/org/apache/catalina/connector/ResponseFacade.java
+++ b/java/org/apache/catalina/connector/ResponseFacade.java
@@ -332,10 +332,10 @@ public class ResponseFacade implements
HttpServletResponse {
/**
* {@inheritDoc}
* <p>
- * Calling <code>sendError</code> with a status code of 103 differs from
the usual
- * behavior. Sending 103 will trigger the container to send a "103 Early
Hints" informational response including all
- * current headers. The application can continue to use the request and
response after calling sendError with a 103
- * status code, including triggering a more typical response of any type.
+ * Calling <code>sendError</code> with a status code of 103 differs from
the usual behavior. Sending 103 will
+ * trigger the container to send a "103 Early Hints" informational
response including all current headers. The
+ * application can continue to use the request and response after calling
sendError with a 103 status code,
+ * including triggering a more typical response of any type.
* <p>
* Starting with Tomcat 12, applications should use {@link
#sendEarlyHints}.
*/
@@ -368,10 +368,10 @@ public class ResponseFacade implements
HttpServletResponse {
/**
* {@inheritDoc}
* <p>
- * Calling <code>sendError</code> with a status code of 103 differs from
the usual
- * behavior. Sending 103 will trigger the container to send a "103 Early
Hints" informational response including all
- * current headers. The application can continue to use the request and
response after calling sendError with a 103
- * status code, including triggering a more typical response of any type.
+ * Calling <code>sendError</code> with a status code of 103 differs from
the usual behavior. Sending 103 will
+ * trigger the container to send a "103 Early Hints" informational
response including all current headers. The
+ * application can continue to use the request and response after calling
sendError with a 103 status code,
+ * including triggering a more typical response of any type.
* <p>
* Starting with Tomcat 12, applications should use {@link
#sendEarlyHints}.
*/
diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index b06fefa61b..f188344da0 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -390,9 +390,9 @@ public abstract class WebappClassLoaderBase extends
URLClassLoader
private volatile LifecycleState state = LifecycleState.NEW;
/*
- * Class resources are not cached since they are loaded on first use and
the resource is then no longer required.
- * It does help, however, to cache classes that are not found as in some
scenarios the same class will be searched
- * for many times and the greater the number of JARs/classes, the longer
that lookup will take.
+ * Class resources are not cached since they are loaded on first use and
the resource is then no longer required. It
+ * does help, however, to cache classes that are not found as in some
scenarios the same class will be searched for
+ * many times and the greater the number of JARs/classes, the longer that
lookup will take.
*/
private final ConcurrentLruCache<String> notFoundClassResources = new
ConcurrentLruCache<>(1000);
diff --git a/java/org/apache/catalina/manager/StatusTransformer.java
b/java/org/apache/catalina/manager/StatusTransformer.java
index 0d759f0d6d..8c66c6e0a1 100644
--- a/java/org/apache/catalina/manager/StatusTransformer.java
+++ b/java/org/apache/catalina/manager/StatusTransformer.java
@@ -517,12 +517,10 @@ public class StatusTransformer {
}
appendJSonValue(writer, "name", jsonName).append(',').println();
indent(writer,
3).append('"').append("threadInfo").append('"').append(':').append('{');
- appendJSonValue(writer, "maxThreads",
mBeanServer.getAttribute(tpName, "maxThreads"))
+ appendJSonValue(writer, "maxThreads",
mBeanServer.getAttribute(tpName, "maxThreads")).append(',');
+ appendJSonValue(writer, "currentThreadCount",
mBeanServer.getAttribute(tpName, "currentThreadCount"))
.append(',');
- appendJSonValue(writer, "currentThreadCount",
- mBeanServer.getAttribute(tpName,
"currentThreadCount")).append(',');
- appendJSonValue(writer, "currentThreadsBusy",
- mBeanServer.getAttribute(tpName, "currentThreadsBusy"));
+ appendJSonValue(writer, "currentThreadsBusy",
mBeanServer.getAttribute(tpName, "currentThreadsBusy"));
writer.append('}');
ObjectName grpName = null;
@@ -537,12 +535,10 @@ public class StatusTransformer {
writer.append(',').println();
indent(writer,
3).append('"').append("requestInfo").append('"').append(':').append('{');
appendJSonValue(writer, "maxTime",
mBeanServer.getAttribute(grpName, "maxTime")).append(',');
- appendJSonValue(writer, "processingTime",
- mBeanServer.getAttribute(grpName,
"processingTime")).append(',');
- appendJSonValue(writer, "requestCount",
mBeanServer.getAttribute(grpName, "requestCount"))
- .append(',');
- appendJSonValue(writer, "errorCount",
mBeanServer.getAttribute(grpName, "errorCount"))
+ appendJSonValue(writer, "processingTime",
mBeanServer.getAttribute(grpName, "processingTime"))
.append(',');
+ appendJSonValue(writer, "requestCount",
mBeanServer.getAttribute(grpName, "requestCount")).append(',');
+ appendJSonValue(writer, "errorCount",
mBeanServer.getAttribute(grpName, "errorCount")).append(',');
appendJSonValue(writer, "bytesReceived",
mBeanServer.getAttribute(grpName, "bytesReceived"))
.append(',');
appendJSonValue(writer, "bytesSent",
mBeanServer.getAttribute(grpName, "bytesSent"));
@@ -904,8 +900,7 @@ public class StatusTransformer {
appendJSonValue(writer, "startTime",
new Date(((Long) mBeanServer.getAttribute(objectName,
"startTime")).longValue()).toString())
.append(',');
- appendJSonValue(writer, "startupTime",
mBeanServer.getAttribute(objectName, "startupTime"))
- .append(',');
+ appendJSonValue(writer, "startupTime",
mBeanServer.getAttribute(objectName, "startupTime")).append(',');
appendJSonValue(writer, "tldScanTime",
mBeanServer.getAttribute(objectName, "tldScanTime"));
if (managerON != null) {
writeManager(writer, managerON, mBeanServer, mode);
@@ -975,18 +970,16 @@ public class StatusTransformer {
.append(',');
appendJSonValue(writer, "sessionCounter",
mBeanServer.getAttribute(objectName, "sessionCounter"))
.append(',');
- appendJSonValue(writer, "maxActive",
mBeanServer.getAttribute(objectName, "maxActive"))
+ appendJSonValue(writer, "maxActive",
mBeanServer.getAttribute(objectName, "maxActive")).append(',');
+ appendJSonValue(writer, "rejectedSessions",
mBeanServer.getAttribute(objectName, "rejectedSessions"))
+ .append(',');
+ appendJSonValue(writer, "expiredSessions",
mBeanServer.getAttribute(objectName, "expiredSessions"))
+ .append(',');
+ appendJSonValue(writer, "sessionMaxAliveTime",
mBeanServer.getAttribute(objectName, "sessionMaxAliveTime"))
.append(',');
- appendJSonValue(writer, "rejectedSessions",
- mBeanServer.getAttribute(objectName,
"rejectedSessions")).append(',');
- appendJSonValue(writer, "expiredSessions",
- mBeanServer.getAttribute(objectName,
"expiredSessions")).append(',');
- appendJSonValue(writer, "sessionMaxAliveTime",
- mBeanServer.getAttribute(objectName,
"sessionMaxAliveTime")).append(',');
appendJSonValue(writer, "sessionAverageAliveTime",
mBeanServer.getAttribute(objectName,
"sessionAverageAliveTime")).append(',');
- appendJSonValue(writer, "processingTime",
- mBeanServer.getAttribute(objectName, "processingTime"));
+ appendJSonValue(writer, "processingTime",
mBeanServer.getAttribute(objectName, "processingTime"));
writer.append('}');
}
@@ -1088,12 +1081,9 @@ public class StatusTransformer {
appendJSonValue(writer, "processingTime",
mBeanServer.getAttribute(objectName, "processingTime"))
.append(',');
appendJSonValue(writer, "maxTime",
mBeanServer.getAttribute(objectName, "maxTime")).append(',');
- appendJSonValue(writer, "requestCount",
mBeanServer.getAttribute(objectName, "requestCount"))
- .append(',');
- appendJSonValue(writer, "errorCount",
mBeanServer.getAttribute(objectName, "errorCount"))
- .append(',');
- appendJSonValue(writer, "loadTime",
mBeanServer.getAttribute(objectName, "loadTime"))
- .append(',');
+ appendJSonValue(writer, "requestCount",
mBeanServer.getAttribute(objectName, "requestCount")).append(',');
+ appendJSonValue(writer, "errorCount",
mBeanServer.getAttribute(objectName, "errorCount")).append(',');
+ appendJSonValue(writer, "loadTime",
mBeanServer.getAttribute(objectName, "loadTime")).append(',');
appendJSonValue(writer, "classLoadTime",
mBeanServer.getAttribute(objectName, "classLoadTime"));
writer.append('}');
}
diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java
b/java/org/apache/catalina/servlets/WebdavServlet.java
index c8d82b4a7a..805f64a229 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -77,9 +77,9 @@ import org.xml.sax.SAXException;
* this configuration.
* <p>
* Mapping a subpath (e.g. <code>/webdav/*</code> to this servlet has the
effect of re-mounting the entire web
- * application under that sub-path, with WebDAV access to all the resources.
To restore the DefaultServlet
- * behavior set <code>serveSubpathOnly</code> to <code>true</code>. The
<code>WEB-INF</code> and
- * <code>META-INF</code> directories are protected in this re-mounted resource
tree.
+ * application under that sub-path, with WebDAV access to all the resources.
To restore the DefaultServlet behavior set
+ * <code>serveSubpathOnly</code> to <code>true</code>. The
<code>WEB-INF</code> and <code>META-INF</code> directories
+ * are protected in this re-mounted resource tree.
* <p>
* To enable WebDAV for a context add the following to web.xml:
*
@@ -134,14 +134,13 @@ import org.xml.sax.SAXException;
* access will be able to edit content available via
http://host:port/context/content using
* http://host:port/context/webdavedit/content
* <p>
- * The Servlet provides support for arbitrary dead properties on all resources
(dead properties are properties
- * whose values are not protected by the server, such as the content length of
a resource). By default the Servlet
- * will use non persistent memory storage for them. Persistence can be
achieved by implementing
- * the <code>PropertyStore</code> interface and configuring the Servlet to use
that store.
- * The <code>propertyStore</code> init-param allows configuring the classname
of the store to use, while the
- * parameters in the form of <code>store.xxx</code> will be set on the store
object as bean properties.
- * For example, this would configure a store with class
<code>com.MyPropertyStore</code>, and set its field
- * <code>myName</code> to value <code>myValue</code>:
+ * The Servlet provides support for arbitrary dead properties on all resources
(dead properties are properties whose
+ * values are not protected by the server, such as the content length of a
resource). By default the Servlet will use
+ * non persistent memory storage for them. Persistence can be achieved by
implementing the <code>PropertyStore</code>
+ * interface and configuring the Servlet to use that store. The
<code>propertyStore</code> init-param allows configuring
+ * the classname of the store to use, while the parameters in the form of
<code>store.xxx</code> will be set on the
+ * store object as bean properties. For example, this would configure a store
with class
+ * <code>com.MyPropertyStore</code>, and set its field <code>myName</code> to
value <code>myValue</code>:
*
* <pre>
* <init-param>
@@ -202,7 +201,7 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
*/
protected static final String SUPPORTED_LOCKS =
"\n
<D:lockentry><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype></D:lockentry>\n"
+
- "
<D:lockentry><D:lockscope><D:shared/></D:lockscope><D:locktype><D:write/></D:locktype></D:lockentry>\n";
+ "
<D:lockentry><D:lockscope><D:shared/></D:lockscope><D:locktype><D:write/></D:locktype></D:lockentry>\n";
/**
* Simple date format for the creation date ISO representation (partial).
@@ -248,8 +247,7 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
private boolean strictIfProcessing = true;
/**
- * Serve resources from the mounted subpath only, restoring the behavior of
- * {@code DefaultServlet}.
+ * Serve resources from the mounted subpath only, restoring the behavior
of {@code DefaultServlet}.
*/
private boolean serveSubpathOnly = false;
@@ -363,10 +361,9 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
/**
- * Handling of dead properties on resources. This interface allows
- * providing storage for dead properties. Store configuration is done
- * through the <code>propertyStore</code> init parameter of the WebDAV
- * Servlet, which should contain the class name of the store.
+ * Handling of dead properties on resources. This interface allows
providing storage for dead properties. Store
+ * configuration is done through the <code>propertyStore</code> init
parameter of the WebDAV Servlet, which should
+ * contain the class name of the store.
*/
public interface PropertyStore {
@@ -388,7 +385,7 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
/**
* Copy resource. Dead properties should be copied to the destination
path.
*
- * @param source the copy source path
+ * @param source the copy source path
* @param destination the copy destination path
*/
void copy(String source, String destination);
@@ -403,19 +400,20 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
/**
* Generate propfind XML fragments for dead properties.
*
- * @param resource the resource path
- * @param property the dead property, if null then all dead properties
must be written
- * @param nameOnly true if only the property name element should be
generated
+ * @param resource the resource path
+ * @param property the dead property, if null then all dead
properties must be written
+ * @param nameOnly true if only the property name element should
be generated
* @param generatedXML the current generated XML for the PROPFIND
response
- * @return true if a property was specified and a corresponding dead
property was found on the resource,
- * false otherwise
+ *
+ * @return true if a property was specified and a corresponding dead
property was found on the resource, false
+ * otherwise
*/
boolean propfind(String resource, Node property, boolean nameOnly,
XMLWriter generatedXML);
/**
* Apply proppatch to the specified resource.
*
- * @param resource the resource path on which to apply the proppatch
+ * @param resource the resource path on which to apply the proppatch
* @param operations the set and remove to apply, the final status
codes of the result should be set on each
* operation
*/
@@ -437,7 +435,8 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
/**
* PROPPATCH operation constructor.
- * @param updateType the update type, either SET or REMOVE
+ *
+ * @param updateType the update type, either SET or REMOVE
* @param propertyNode the XML node that contains the property name
(and value if SET)
*/
public ProppatchOperation(PropertyUpdateType updateType, Node
propertyNode) {
@@ -489,7 +488,9 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
* Type of PROPFIND request.
*/
enum PropfindType {
- FIND_BY_PROPERTY, FIND_ALL_PROP, FIND_PROPERTY_NAMES
+ FIND_BY_PROPERTY,
+ FIND_ALL_PROP,
+ FIND_PROPERTY_NAMES
}
@@ -497,7 +498,8 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
* Type of property update in a PROPPATCH.
*/
enum PropertyUpdateType {
- SET, REMOVE
+ SET,
+ REMOVE
}
@@ -1757,8 +1759,9 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
} else {
if ((parentPath != path && parentLock.depth > 0) ||
parentPath == path) {
if (parentLock.isExclusive()) {
- if (lockTokenHeader.contains(":" +
parentLock.token + ">") && (parentLock.principal == null ||
-
parentLock.principal.equals(req.getRemoteUser()))) {
+ if (lockTokenHeader.contains(":" +
parentLock.token + ">") &&
+ (parentLock.principal == null ||
+
parentLock.principal.equals(req.getRemoteUser()))) {
resourceLocks.remove(parentPath);
unlocked = true;
break;
@@ -1958,7 +1961,8 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
(lock.principal == null ||
lock.principal.equals(principal))) {
return false;
}
- // Since it is a shared lock, continue
to look up the tree but note that there was a lock
+ // Since it is a shared lock, continue
to look up the tree but note that there
+ // was a lock
unmatchedSharedLock = true;
}
}
@@ -2575,8 +2579,8 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
for (Node propertyNode : properties) {
String property = getDAVNode(propertyNode);
- boolean protectedProperty =
- property != null &&
(!(property.equals("displayname") || property.equals("getcontentlanguage")));
+ boolean protectedProperty = property != null &&
+ (!(property.equals("displayname") ||
property.equals("getcontentlanguage")));
if (property == null || !protectedProperty) {
if (!store.propfind(path, propertyNode, false,
generatedXML)) {
propertiesNotFound.add(propertyNode);
diff --git a/java/org/apache/catalina/startup/Catalina.java
b/java/org/apache/catalina/startup/Catalina.java
index 2a83d50636..4e007803fd 100644
--- a/java/org/apache/catalina/startup/Catalina.java
+++ b/java/org/apache/catalina/startup/Catalina.java
@@ -928,7 +928,8 @@ public class Catalina {
code.append(" implements ");
code.append(ServerXml.class.getName().replace('$', '.')).append("
{").append(System.lineSeparator());
code.append("public void load(").append(Catalina.class.getName());
- code.append(' ').append(digester.toVariableName(this)).append(")
throws Exception {").append(System.lineSeparator());
+ code.append(' ').append(digester.toVariableName(this)).append(")
throws Exception {")
+ .append(System.lineSeparator());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]