Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gatorsmile committed Jun 13, 2018
1 parent 07f71d3 commit 52e706b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ public Object eval(String xml, String path, QName qname) throws XPathExpressionE
initializeDocumentBuilderFactory();
builder = dbf.newDocumentBuilder();
} catch (ParserConfigurationException e) {
throw new RuntimeException("Error instantiating DocumentBuilder, cannot build xml parser", e);
throw new RuntimeException(
"Error instantiating DocumentBuilder, cannot build xml parser", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,12 @@ class UDFXPathUtilSuite extends SparkFunSuite {
FileUtils.writeStringToFile(tempFile, secretValue)

val xml =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + "<!DOCTYPE test [ \n" +
" <!ENTITY embed SYSTEM \"" + fname + "\"> \n" + "]>\n" + "<foo>&embed;</foo>"
s"""<?xml version="1.0" encoding="utf-8"?>
|<!DOCTYPE test [
| <!ENTITY embed SYSTEM "$fname">
|]>
|<foo>&embed;</foo>
""".stripMargin
val evaled = new UDFXPathUtil().evalString(xml, "/foo")
assert(evaled.isEmpty)
}
Expand Down

0 comments on commit 52e706b

Please sign in to comment.