bug 61170: add extra logging to SaxHelper.

Thanks to PJ Fanning for the patch!
This closes #58 on github.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798792 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2017-06-15 05:00:25 +00:00
parent 87591edbf3
commit 7413857e16
1 changed files with 14 additions and 3 deletions

View File

@ -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) {