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

markt-asf 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 5bb1a968e1 Optimise
5bb1a968e1 is described below

commit 5bb1a968e1f808b932a336c6eb544c0e2ee2351a
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Oct 19 20:06:30 2026 +0100

    Optimise
---
 java/org/apache/catalina/startup/ContextConfig.java | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/startup/ContextConfig.java 
b/java/org/apache/catalina/startup/ContextConfig.java
index 6c8326bf18..b09728b454 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -2505,13 +2505,10 @@ public class ContextConfig implements LifecycleListener 
{
 
     private void populateJavaClassCache(String className, JavaClass javaClass,
             Map<String,JavaClassCacheEntry> javaClassCache) {
-        if (javaClassCache.containsKey(className)) {
+        if (javaClassCache.putIfAbsent(className, new 
JavaClassCacheEntry(javaClass)) != null) {
             return;
         }
 
-        // Add this class to the cache
-        javaClassCache.put(className, new JavaClassCacheEntry(javaClass));
-
         populateJavaClassCache(javaClass.getSuperclassName(), javaClassCache);
 
         for (String interfaceName : javaClass.getInterfaceNames()) {


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

Reply via email to