tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1061405 - in /tomcat/tc5.5.x/trunk: container/catalina/src/share/org/apache/naming/resources/ImmutableNameNotFoundException.java container/webapps/docs/changelog.xml jasper/src/share/org/apache/jasper/compiler/JspDocumentParser.java
Date Thu, 20 Jan 2011 17:21:40 GMT
Author: markt
Date: Thu Jan 20 17:21:39 2011
New Revision: 1061405

URL: http://svn.apache.org/viewvc?rev=1061405&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50460
Avoid leak caused by using a cached exception instance

Modified:
    tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/naming/resources/ImmutableNameNotFoundException.java
    tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml
    tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/JspDocumentParser.java

Modified: tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/naming/resources/ImmutableNameNotFoundException.java
URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/naming/resources/ImmutableNameNotFoundException.java?rev=1061405&r1=1061404&r2=1061405&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/naming/resources/ImmutableNameNotFoundException.java
(original)
+++ tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/naming/resources/ImmutableNameNotFoundException.java
Thu Jan 20 17:21:39 2011
@@ -37,4 +37,8 @@ public class ImmutableNameNotFoundExcept
     public void setResolverName(Name name) {}
     public void setRootCause(Throwable e) {}
 
+    public synchronized Throwable fillInStackTrace() {
+        // This class does not provide a stack trace
+        return this;
+    }
 }

Modified: tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml?rev=1061405&r1=1061404&r2=1061405&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml (original)
+++ tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml Thu Jan 20 17:21:39 2011
@@ -71,6 +71,10 @@
       <fix>
         Avoid unnecessary cast in StandardContext. (markt)
       </fix>
+      <fix>
+        <bug>50460</bug>: Avoid a possible memory leak caused by using a cached
+        exception instance. (kkolinko)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">

Modified: tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/JspDocumentParser.java
URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/JspDocumentParser.java?rev=1061405&r1=1061404&r2=1061405&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/JspDocumentParser.java
(original)
+++ tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/JspDocumentParser.java
Thu Jan 20 17:21:39 2011
@@ -60,11 +60,6 @@ class JspDocumentParser
         "http://xml.org/sax/properties/lexical-handler";
     private static final String JSP_URI = "http://java.sun.com/JSP/Page";
 
-    private static final EnableDTDValidationException ENABLE_DTD_VALIDATION_EXCEPTION =
-        new EnableDTDValidationException(
-            "jsp.error.enable_dtd_validation",
-            null);
-
     private ParserController parserController;
     private JspCompilationContext ctxt;
     private PageInfo pageInfo;
@@ -732,7 +727,8 @@ class JspDocumentParser
     public void startDTD(String name, String publicId, String systemId)
         throws SAXException {
         if (!isValidating) {
-            fatalError(ENABLE_DTD_VALIDATION_EXCEPTION);
+            fatalError(new EnableDTDValidationException(
+                    "jsp.error.enable_dtd_validation", null));
         }
 
         inDTD = true;
@@ -1425,6 +1421,11 @@ class JspDocumentParser
         EnableDTDValidationException(String message, Locator loc) {
             super(message, loc);
         }
+
+        public synchronized Throwable fillInStackTrace() {
+            // This class does not provide a stack trace
+            return this;
+        }
     }
 
     private static String getBodyType(Node.CustomTag custom) {



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


Mime
View raw message