Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,7 @@ private static XMLReader createXmlReader() throws SAXException {
return comSunXmlReader;
}

String key = "org.xml.sax.driver";
String oldParser = System.getProperty(key);
System.clearProperty(key); // There's a "slight" problem with this an parallel maven: It does not work ;)

try {
return org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
} finally {
if (oldParser != null) {
System.setProperty(key, oldParser);
}
}
return org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
}

private static XMLReader instantiate(String s) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ public void trimming() {
assertEquals(" preserve space ", dom.getChild("element6").getValue());
}

@Test
public void buildDoesNotModifySaxDriverProperty() {
String key = "org.xml.sax.driver";
String original = System.getProperty(key);
Xpp3DomBuilder.build(new StringReader("<root/>"));
assertEquals(original, System.getProperty(key));
}

@Test
public void testMalformedXml() {
try {
Expand Down
Loading