Sonar issues: Mark two places where we catch Error/Throwable as "On purpose"

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1775122 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
centic 2016-12-19 15:25:20 +00:00
parent 9a04e2dd07
commit c44cf6ab38
2 changed files with 3 additions and 6 deletions

View File

@ -121,8 +121,8 @@ public final class DocumentHelper {
dbf.setAttribute("http://apache.org/xml/properties/security-manager", mgr);
// Stop once one can be setup without error
return;
} catch (Throwable t) {
logger.log(POILogger.WARN, "SAX Security Manager could not be setup", t);
} catch (Throwable e) { // NOSONAR - also catch things like NoClassDefError here
logger.log(POILogger.WARN, "SAX Security Manager could not be setup", e);
}
}
}
@ -172,5 +172,4 @@ public final class DocumentHelper {
public static void addNamespaceDeclaration(Element element, Namespace namespace) {
addNamespaceDeclaration(element, namespace.getPrefix(), namespace.getNamespaceURI());
}
}

View File

@ -88,10 +88,8 @@ public final class SAXHelper {
xmlReader.setProperty("http://apache.org/xml/properties/security-manager", mgr);
// Stop once one can be setup without error
return;
} catch (Exception e) {
} catch (Throwable e) { // NOSONAR - also catch things like NoClassDefError here
logger.log(POILogger.WARN, "SAX Security Manager could not be setup", e);
} catch (Error err) {
logger.log(POILogger.WARN, "SAX Security Manager could not be setup", err);
}
}
}