You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2017/10/15 05:27:14 UTC
[2/5] ant git commit: properly handle factory configuration exception
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 <bo...@apache.org>
Authored: Sun Oct 15 07:24:40 2017 +0200
Committer: Stefan Bodewig <bo...@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;