incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1408635 - /sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/PipelineImpl.java
Date Tue, 13 Nov 2012 08:34:46 GMT
Author: cziegeler
Date: Tue Nov 13 08:34:45 2012
New Revision: 1408635

URL: http://svn.apache.org/viewvc?rev=1408635&view=rev
Log:
SLING-2661 :  Components might not be disposed if exception is occuring 

Modified:
    sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/PipelineImpl.java

Modified: sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/PipelineImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/PipelineImpl.java?rev=1408635&r1=1408634&r2=1408635&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/PipelineImpl.java
(original)
+++ sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/PipelineImpl.java
Tue Nov 13 08:34:45 2012
@@ -182,11 +182,13 @@ public class PipelineImpl implements Pro
      */
     public void finished(final boolean errorOccured) throws IOException {
         IOException ioe = null;
-        // if an error occured, we only clean up
+        // if an error occurred, we only clean up
         if ( !errorOccured ) {
             try {
                 this.generator.finished();
-            } catch (SAXException se) {
+            } catch (final IOException localIOE) {
+                ioe = localIOE;
+            } catch (final SAXException se) {
                 if ( se.getCause() != null && se.getCause() instanceof IOException
) {
                     ioe = (IOException)se.getCause();
                 } else {
@@ -195,7 +197,7 @@ public class PipelineImpl implements Pro
                 }
             }
         }
-        // now dispose component
+        // now dispose components
         if ( this.generator != null ) {
             this.generator.dispose();
         }
@@ -209,6 +211,7 @@ public class PipelineImpl implements Pro
         if ( this.serializer != null ) {
             this.serializer.dispose();
         }
+        // throw exception
         if ( ioe != null ) {
             throw ioe;
         }



Mime
View raw message