incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r898664 - in /sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime: PerThreadTagHandlerPool.java TagHandlerPool.java
Date Wed, 13 Jan 2010 07:03:07 GMT
Author: cziegeler
Date: Wed Jan 13 07:03:06 2010
New Revision: 898664

URL: http://svn.apache.org/viewvc?rev=898664&view=rev
Log:
SLING-1284 : MemoryLeak: ThreadLocal variable is never cleared - remove unused per thread
tag handler pool to clearly state that this is never used.

Removed:
    sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/PerThreadTagHandlerPool.java
Modified:
    sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/TagHandlerPool.java

Modified: sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/TagHandlerPool.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/TagHandlerPool.java?rev=898664&r1=898663&r2=898664&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/TagHandlerPool.java
(original)
+++ sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/TagHandlerPool.java
Wed Jan 13 07:03:06 2010
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,25 +38,13 @@
     public static String OPTION_MAXSIZE="tagpoolMaxSize";
 
     private Log log = LogFactory.getLog(TagHandlerPool.class);
-    
+
     // index of next available tag handler
     private int current;
     protected AnnotationProcessor annotationProcessor = null;
 
     public static TagHandlerPool getTagHandlerPool( ServletConfig config) {
-        TagHandlerPool result=null;
-
-        String tpClassName=getOption( config, OPTION_TAGPOOL, null);
-        if( tpClassName != null ) {
-            try {
-                Class c=Class.forName( tpClassName );
-                result=(TagHandlerPool)c.newInstance();
-            } catch (Exception e) {
-                e.printStackTrace();
-                result=null;
-            }
-        }
-        if( result==null ) result=new TagHandlerPool();
+        final TagHandlerPool result = new TagHandlerPool();
         result.init(config);
 
         return result;
@@ -77,7 +65,7 @@
         }
         this.handlers = new Tag[maxSize];
         this.current = -1;
-        this.annotationProcessor = 
+        this.annotationProcessor =
             (AnnotationProcessor) config.getServletContext().getAttribute(AnnotationProcessor.class.getName());
     }
 
@@ -95,6 +83,7 @@
      * @param capacity Tag handler pool capacity
      * @deprecated Use static getTagHandlerPool
      */
+    @Deprecated
     public TagHandlerPool(int capacity) {
 	this.handlers = new Tag[capacity];
 	this.current = -1;
@@ -150,7 +139,7 @@
             try {
                 AnnotationHelper.preDestroy(annotationProcessor, handler);
             } catch (Exception e) {
-                log.warn("Error processing preDestroy on tag instance of " 
+                log.warn("Error processing preDestroy on tag instance of "
                         + handler.getClass().getName(), e);
             }
         }
@@ -167,7 +156,7 @@
                 try {
                     AnnotationHelper.preDestroy(annotationProcessor, handlers[i]);
                 } catch (Exception e) {
-                    log.warn("Error processing preDestroy on tag instance of " 
+                    log.warn("Error processing preDestroy on tag instance of "
                             + handlers[i].getClass().getName(), e);
                 }
             }



Mime
View raw message