poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1798792 - /poi/trunk/src/ooxml/java/org/apache/poi/util/SAXHelper.java
Date Thu, 15 Jun 2017 05:00:25 GMT
Author: onealj
Date: Thu Jun 15 05:00:25 2017
New Revision: 1798792

URL: http://svn.apache.org/viewvc?rev=1798792&view=rev
Log:
bug 61170: add extra logging to SaxHelper.
Thanks to PJ Fanning for the patch!
This closes #58 on github.

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/util/SAXHelper.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/util/SAXHelper.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/util/SAXHelper.java?rev=1798792&r1=1798791&r2=1798792&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/util/SAXHelper.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/util/SAXHelper.java Thu Jun 15 05:00:25 2017
@@ -62,9 +62,20 @@ public final class SAXHelper {
     
     private static final SAXParserFactory saxFactory;
     static {
-        saxFactory = SAXParserFactory.newInstance();
-        saxFactory.setValidating(false);
-        saxFactory.setNamespaceAware(true);
+        try {
+            saxFactory = SAXParserFactory.newInstance();
+            saxFactory.setValidating(false);
+            saxFactory.setNamespaceAware(true);
+        } catch (RuntimeException re) {
+            logger.log(POILogger.WARN, "Failed to create SAXParserFactory", re);
+            throw re;
+        } catch (Exception e) {
+            logger.log(POILogger.WARN, "Failed to create SAXParserFactory", e);
+            throw new RuntimeException("Failed to create SAXParserFactory", e);
+        } catch (Error e) {
+            logger.log(POILogger.WARN, "Failed to create SAXParserFactory", e);
+            throw e;
+        }
     }
             
     private static void trySetSAXFeature(XMLReader xmlReader, String feature) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message