You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by sc...@apache.org on 2007/10/29 20:28:20 UTC

svn commit: r589810 - /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java

Author: scheu
Date: Mon Oct 29 12:28:19 2007
New Revision: 589810

URL: http://svn.apache.org/viewvc?rev=589810&view=rev
Log:
Quick Change to swallow (but log) an exception that occurs during the close of the 
parser.

There is nothing that the consumer could do with the exception, and since this is occuring
during resource cleanup, all processing is done. 

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java?rev=589810&r1=589809&r2=589810&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java Mon Oct 29 12:28:19 2007
@@ -34,6 +34,8 @@
 import org.apache.axiom.om.impl.OMNodeEx;
 import org.apache.axiom.om.impl.util.OMSerializerUtil;
 import org.apache.axiom.om.util.StAXUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamConstants;
@@ -51,6 +53,8 @@
  */
 public abstract class StAXBuilder implements OMXMLParserWrapper {
 
+    private static Log log = LogFactory.getLog(StAXBuilder.class);
+    
     /** Field parser */
     protected XMLStreamReader parser;
 
@@ -610,8 +614,13 @@
             if (!isClosed()) {
                 parser.close();
             }
-        } catch (XMLStreamException e) {
-            throw new RuntimeException(e);
+        } catch (Throwable e) {
+            // Can't see a reason why we would want to surface an exception
+            // while closing the parser.
+            if (log.isDebugEnabled()) {
+                log.debug("Exception occurred during parser close.  " +
+                                "Processing continues. " + e);
+            }
         } finally {
             _isClosed = true;
             done = true;



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