This is an automated email from the ASF dual-hosted git repository.

rmaucher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 96b05fe3bf Add comments
96b05fe3bf is described below

commit 96b05fe3bfee2a56ad2f11cb1432d213140397af
Author: remm <[email protected]>
AuthorDate: Wed May 27 10:15:36 2026 +0200

    Add comments
---
 java/org/apache/catalina/core/StandardHostValve.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/core/StandardHostValve.java 
b/java/org/apache/catalina/core/StandardHostValve.java
index f837c1363e..36adeeec0f 100644
--- a/java/org/apache/catalina/core/StandardHostValve.java
+++ b/java/org/apache/catalina/core/StandardHostValve.java
@@ -50,7 +50,7 @@ final class StandardHostValve extends ValveBase {
     private static final Log log = LogFactory.getLog(StandardHostValve.class);
     private static final StringManager sm = 
StringManager.getManager(StandardHostValve.class);
 
-    // Saves a call to getClassLoader() on very request. Under high load these
+    // Saves a call to getClassLoader() on every request. Under high load these
     // calls took just long enough to appear as a hot spot (although a very
     // minor one) in a profiler.
     private static final ClassLoader MY_CLASSLOADER = 
StandardHostValve.class.getClassLoader();
@@ -94,6 +94,8 @@ final class StandardHostValve extends ValveBase {
         boolean asyncAtStart = request.isAsync();
 
         try {
+            // No need to check the return value, the original classloader
+            // will always be considered to be the Catalina one
             context.bind(MY_CLASSLOADER);
 
             if (!asyncAtStart && 
!context.fireRequestInitEvent(request.getRequest())) {
@@ -161,6 +163,7 @@ final class StandardHostValve extends ValveBase {
                 request.getSession(false);
             }
 
+            // Always reset the classloader to the Catalina one
             context.unbind(MY_CLASSLOADER);
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to