Skip to content

Commit

Permalink
Re-apply code formatting. No functional change.
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Nov 22, 2024
1 parent f60ba37 commit ca576e6
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 82 deletions.
4 changes: 2 additions & 2 deletions java/org/apache/catalina/WebResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
16 changes: 8 additions & 8 deletions java/org/apache/catalina/connector/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -1080,10 +1080,10 @@ public void sendEarlyHints() {
/**
* {@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}.
*/
Expand All @@ -1096,10 +1096,10 @@ public void sendError(int status) throws IOException {
/**
* {@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}.
*/
Expand Down
16 changes: 8 additions & 8 deletions java/org/apache/catalina/connector/ResponseFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ public void sendEarlyHints() {
/**
* {@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}.
*/
Expand All @@ -353,10 +353,10 @@ public void sendError(int sc, String msg) throws IOException {
/**
* {@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}.
*/
Expand Down
6 changes: 3 additions & 3 deletions java/org/apache/catalina/loader/WebappClassLoaderBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,9 @@ protected WebappClassLoaderBase(ClassLoader parent) {
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);

Expand Down
44 changes: 17 additions & 27 deletions java/org/apache/catalina/manager/StatusTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,10 @@ public static void writeConnectorState(PrintWriter writer, ObjectName tpName, St
}
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;
Expand All @@ -471,12 +469,10 @@ public static void writeConnectorState(PrintWriter writer, ObjectName tpName, St
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"));
Expand Down Expand Up @@ -838,8 +834,7 @@ protected static void writeContext(PrintWriter writer, ObjectName objectName, MB
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);
Expand Down Expand Up @@ -909,18 +904,16 @@ public static void writeManager(PrintWriter writer, ObjectName objectName, MBean
.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('}');
}

Expand Down Expand Up @@ -1022,12 +1015,9 @@ public static void writeWrapper(PrintWriter writer, ObjectName objectName, MBean
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('}');
}
Expand Down
Loading

0 comments on commit ca576e6

Please sign in to comment.