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 608d2c60a9 Re-apply code formatting. No functional change. 608d2c60a9 is described below commit 608d2c60a9e00c60cfa97c25aa4c846e7e400d9c Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Nov 22 22:08:03 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 ++--- .../apache/catalina/manager/StatusTransformer.java | 44 ++++++-------- .../apache/catalina/servlets/WebdavServlet.java | 70 ++++++++++++---------- java/org/apache/catalina/startup/Catalina.java | 3 +- 6 files changed, 74 insertions(+), 79 deletions(-) diff --git a/java/org/apache/catalina/WebResource.java b/java/org/apache/catalina/WebResource.java index ba5adec5e6..692674d487 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 a5066f915d..7bd72bd566 100644 --- a/java/org/apache/catalina/connector/Response.java +++ b/java/org/apache/catalina/connector/Response.java @@ -1056,10 +1056,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}. */ @@ -1072,10 +1072,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 51f6a8e212..ce46bd86da 100644 --- a/java/org/apache/catalina/connector/ResponseFacade.java +++ b/java/org/apache/catalina/connector/ResponseFacade.java @@ -252,10 +252,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}. */ @@ -274,10 +274,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/manager/StatusTransformer.java b/java/org/apache/catalina/manager/StatusTransformer.java index 903d880347..685258eca7 100644 --- a/java/org/apache/catalina/manager/StatusTransformer.java +++ b/java/org/apache/catalina/manager/StatusTransformer.java @@ -451,12 +451,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; @@ -471,12 +469,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")); @@ -838,8 +834,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); @@ -909,18 +904,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('}'); } @@ -1022,12 +1015,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 8de9008314..6d4a8f3379 100644 --- a/java/org/apache/catalina/servlets/WebdavServlet.java +++ b/java/org/apache/catalina/servlets/WebdavServlet.java @@ -78,9 +78,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: * @@ -135,14 +135,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> @@ -203,7 +202,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). @@ -249,8 +248,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; @@ -364,10 +362,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 { @@ -389,7 +386,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); @@ -404,19 +401,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 */ @@ -438,7 +436,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) { @@ -490,7 +489,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 } @@ -498,7 +499,8 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen * Type of property update in a PROPPATCH. */ enum PropertyUpdateType { - SET, REMOVE + SET, + REMOVE } @@ -1758,8 +1760,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; @@ -1959,7 +1962,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; } } @@ -2576,8 +2580,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 8d33f85a9c..e659be32c1 100644 --- a/java/org/apache/catalina/startup/Catalina.java +++ b/java/org/apache/catalina/startup/Catalina.java @@ -930,7 +930,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: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org