Skip to content
Browse files

Small change to create a single XPathFactory. Makes changing the XPat…

…h factory easier
  • Loading branch information...
1 parent 5074cc7 commit ae69ae68f52eafc7f5405831573da71f66fda4de @rolfl rolfl committed Feb 11, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 contrib/src/java/org/jdom2/contrib/perf/PerfDoc.java
View
6 contrib/src/java/org/jdom2/contrib/perf/PerfDoc.java
@@ -356,14 +356,16 @@ private void dump(Format format) throws IOException {
}
public long xpath() throws Exception {
+
+ final XPathFactory fac = XPathFactory.instance();
xpathTime = PerfTest.timeRun(new TimeRunnable() {
@Override
public void run() throws Exception {
- XPathExpression<Object> patha = XPathFactory.instance().compile("//@null");
+ XPathExpression<Object> patha = fac.compile("//@null");
patha.evaluate(document);
// select everything
- XPathExpression<?> pathb = XPathFactory.instance().compile("//node()");
+ XPathExpression<?> pathb = fac.compile("//node()");
pathb.evaluate(document);
}
});

0 comments on commit ae69ae6

Please sign in to comment.
Something went wrong with that request. Please try again.