cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r472600 - in /cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks: BlockConnection.java DispatcherServlet.java
Date Wed, 08 Nov 2006 19:24:33 GMT
Author: joerg
Date: Wed Nov  8 11:24:33 2006
New Revision: 472600

URL: http://svn.apache.org/viewvc?view=rev&rev=472600
Log:
do the clean up in finally blocks to ensure they are executed

Modified:
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockConnection.java
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/DispatcherServlet.java

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockConnection.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockConnection.java?view=diff&rev=472600&r1=472599&r2=472600
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockConnection.java
(original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockConnection.java
Wed Nov  8 11:24:33 2006
@@ -117,11 +117,11 @@
             
             byte[] out = os.toByteArray();
             
-            os.close();
-            
             return new ByteArrayInputStream(out);
         } catch (ServletException e) {
             throw new CascadingIOException("BlockConnection " + e.getMessage(), e);
+        } finally {
+            os.close();
         }
     }
 

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/DispatcherServlet.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/DispatcherServlet.java?view=diff&rev=472600&r1=472599&r2=472600
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/DispatcherServlet.java
(original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/DispatcherServlet.java
Wed Nov  8 11:24:33 2006
@@ -22,8 +22,6 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -31,7 +29,6 @@
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.cocoon.ProcessingUtil;
@@ -95,7 +92,7 @@
         Servlet servlet = null;
         while (servlet == null && index != -1) {
             path = path.substring(0, index);
-            servlet = (Servlet) mountableServlets.get(path);
+            servlet = (Servlet)this.mountableServlets.get(path);
             index = path.lastIndexOf('/');
         }
         if (servlet == null) {
@@ -113,9 +110,12 @@
                 " mountPath=" + path +
                 " servletPath=" + request.getServletPath() +
                 " pathInfo=" + request.getPathInfo());
-        servlet.service(request, res);
-
-        ProcessingUtil.cleanup();
+        
+        try {
+            servlet.service(request, res);
+        } finally {
+            ProcessingUtil.cleanup();
+        }
     }
     
     private void getInterfaces(Set interfaces, Class clazz) {



Mime
View raw message