tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1366953 - /tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
Date Sun, 29 Jul 2012 21:21:09 GMT
Author: markt
Date: Sun Jul 29 21:21:08 2012
New Revision: 1366953

URL: http://svn.apache.org/viewvc?rev=1366953&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53535
Reduce memory footprint when performing class scanning on Context start.
Patch provided by Cedomir Igaly

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1366953&r1=1366952&r2=1366953&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Sun Jul 29 21:21:08 2012
@@ -2122,10 +2122,8 @@ public class ContextConfig implements Li
     private void populateSCIsForCacheEntry(JavaClassCacheEntry cacheEntry) {
         Set<ServletContainerInitializer> result = new HashSet<>();
 
-        JavaClass javaClass = cacheEntry.getJavaClass();
-
         // Super class
-        String superClassName = javaClass.getSuperclassName();
+        String superClassName = cacheEntry.getSuperclassName();
         JavaClassCacheEntry superClassCacheEntry =
                 javaClassCache.get(superClassName);
 
@@ -2145,7 +2143,7 @@ public class ContextConfig implements Li
         result.addAll(getSCIsForClass(superClassName));
 
         // Interfaces
-        for (String interfaceName : javaClass.getInterfaceNames()) {
+for (String interfaceName : cacheEntry.getInterfaceNames()) {
             JavaClassCacheEntry interfaceEntry =
                     javaClassCache.get(interfaceName);
             // A null could mean that the class not present in application or
@@ -2589,15 +2587,23 @@ public class ContextConfig implements Li
     }
 
     private static class JavaClassCacheEntry {
-        private final JavaClass javaClass;
+        public final String superclassName;
+
+        public final String[] interfaceNames;
+
         private Set<ServletContainerInitializer> sciSet = null;
 
         public JavaClassCacheEntry(JavaClass javaClass) {
-            this.javaClass = javaClass;
+            superclassName = javaClass.getSuperclassName();
+            interfaceNames = javaClass.getInterfaceNames();
+        }
+
+        public String getSuperclassName() {
+            return superclassName;
         }
 
-        public JavaClass getJavaClass() {
-            return javaClass;
+        public String[] getInterfaceNames() {
+            return interfaceNames;
         }
 
         public Set<ServletContainerInitializer> getSciSet() {



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


Mime
View raw message