This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 087f58bd06 Optimise
087f58bd06 is described below
commit 087f58bd067317a772419c28f86f14dc58fc34b6
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 b9f95810da..908754eb72 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -2509,13 +2509,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]