diff options
author | Dominik Stadler <centic@apache.org> | 2016-12-19 15:25:20 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2016-12-19 15:25:20 +0000 |
commit | 765f613b717a3f0cdc24ec9c58bc10cb4b71e3f2 (patch) | |
tree | 3231a6295edf11d07bc8cc685a89da4201b62e51 | |
parent | c74d5cf7272930a9f2c795e28f472e558fb89b84 (diff) | |
download | poi-765f613b717a3f0cdc24ec9c58bc10cb4b71e3f2.tar.gz poi-765f613b717a3f0cdc24ec9c58bc10cb4b71e3f2.zip |
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
-rw-r--r-- | src/ooxml/java/org/apache/poi/util/DocumentHelper.java | 5 | ||||
-rw-r--r-- | src/ooxml/java/org/apache/poi/util/SAXHelper.java | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/ooxml/java/org/apache/poi/util/DocumentHelper.java b/src/ooxml/java/org/apache/poi/util/DocumentHelper.java index 3b7d68ae57..1ec47953ab 100644 --- a/src/ooxml/java/org/apache/poi/util/DocumentHelper.java +++ b/src/ooxml/java/org/apache/poi/util/DocumentHelper.java @@ -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()); } - } diff --git a/src/ooxml/java/org/apache/poi/util/SAXHelper.java b/src/ooxml/java/org/apache/poi/util/SAXHelper.java index 1fbe744b05..6a957c2993 100644 --- a/src/ooxml/java/org/apache/poi/util/SAXHelper.java +++ b/src/ooxml/java/org/apache/poi/util/SAXHelper.java @@ -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); } } } |