tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r828759 - /tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
Date Thu, 22 Oct 2009 15:44:06 GMT
Author: markt
Date: Thu Oct 22 15:44:06 2009
New Revision: 828759

URL: http://svn.apache.org/viewvc?rev=828759&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47987
Limit size of not found resources cache

Modified:
    tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=828759&r1=828758&r2=828759&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Thu Oct 22 15:44:06
2009
@@ -41,6 +41,8 @@
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
 import java.util.Vector;
 import java.util.jar.Attributes;
 import java.util.jar.JarEntry;
@@ -244,7 +246,14 @@
     /**
      * The list of not found resources.
      */
-    protected HashMap<String, String> notFoundResources = new HashMap<String, String>();
+    protected HashMap<String, String> notFoundResources =
+        new LinkedHashMap<String, String>() {
+        private static final long serialVersionUID = 1L;
+        protected boolean removeEldestEntry(
+                Map.Entry<String, String> eldest) {
+            return size() > 1000;
+        }
+    };
 
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message