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

markt-asf 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 9bf0631bb4 Optimise
9bf0631bb4 is described below

commit 9bf0631bb4b0e1f6993ce261c4ecaa09e079cfc0
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 7c9ad39d31..7861e65fe4 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -2504,13 +2504,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