aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorC. Sean Young <csyoung@google.com>2015-06-16 15:08:35 -0500
committerC. Sean Young <csyoung@google.com>2015-06-16 15:12:16 -0500
commitd370cc3f5f6feeeb76c2c4e288f960a7fc83112a (patch)
treed6a8d55dd6508b4e30911b17a2f015496565962d
parent8fffa0b462fe681b9367e5d5cc3ec33bc47245a5 (diff)
downloadjdiff-d370cc3f5f6feeeb76c2c4e288f960a7fc83112a.tar.gz
Fix an additional use of an external parsing library.
This one was missed in the initial removal. See Ia5f8acbbeff54af51986512505933e83f7919d73 Change-Id: I1f189f0f2c424911199469da07a8359e24b47c08
-rwxr-xr-xsrc/jdiff/Comments.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/jdiff/Comments.java b/src/jdiff/Comments.java
index 066e4f0..b732596 100755
--- a/src/jdiff/Comments.java
+++ b/src/jdiff/Comments.java
@@ -2,6 +2,7 @@ package jdiff;
import java.io.*;
import java.util.*;
+import javax.xml.parsers.ParserConfigurationException;
/* For SAX XML parsing */
import org.xml.sax.Attributes;
@@ -60,18 +61,15 @@ public class Comments {
DefaultHandler handler = new CommentsHandler(oldComments_);
XMLReader parser = null;
try {
- String parserName = System.getProperty("org.xml.sax.driver");
- if (parserName == null) {
- parser = org.xml.sax.helpers.XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
- } else {
- // Let the underlying mechanisms try to work out which
- // class to instantiate
- parser = org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
- }
+ parser = javax.xml.parsers.SAXParserFactory.newInstance().newSAXParser().getXMLReader();
} catch (SAXException saxe) {
System.out.println("SAXException: " + saxe);
saxe.printStackTrace();
System.exit(1);
+ } catch (ParserConfigurationException pce) {
+ System.out.println("ParserConfigurationException: " + pce);
+ pce.printStackTrace();
+ System.exit(1);
}
if (XMLToAPI.validateXML) {