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 14b2d4501a
commit f66153c810

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