ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [2/5] ant git commit: properly handle factory configuration exception
Date Sun, 15 Oct 2017 05:27:14 GMT
properly handle factory configuration exception

based on patch by Kui Liu


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/20fe0ffa
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/20fe0ffa
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/20fe0ffa

Branch: refs/heads/master
Commit: 20fe0ffaf6c8965beccad519c644df2321f5006c
Parents: 99a7f59
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sun Oct 15 07:24:40 2017 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sun Oct 15 07:24:40 2017 +0200

----------------------------------------------------------------------
 src/main/org/apache/tools/ant/Diagnostics.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/20fe0ffa/src/main/org/apache/tools/ant/Diagnostics.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/Diagnostics.java b/src/main/org/apache/tools/ant/Diagnostics.java
index 4ad57a0..e4a243b 100644
--- a/src/main/org/apache/tools/ant/Diagnostics.java
+++ b/src/main/org/apache/tools/ant/Diagnostics.java
@@ -195,8 +195,12 @@ public final class Diagnostics {
      * @return parser or null for trouble
      */
     private static SAXParser getSAXParser() {
-        SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
-        if (saxParserFactory == null) {
+        SAXParserFactory saxParserFactory = null;
+        try {
+            saxParserFactory = SAXParserFactory.newInstance();
+        } catch (Exception e) {
+            // ignore
+            ignoreThrowable(e);
             return null;
         }
         SAXParser saxParser = null;


Mime
View raw message