From e4fa554c8de5274dd7437a92e7f978cb09486429 Mon Sep 17 00:00:00 2001 From: Carlos Miranda Date: Fri, 10 Aug 2018 11:09:14 +0800 Subject: [PATCH 1/2] #82 XpathFactory moved to ThreadLocal --- src/main/java/org/xembly/XpathDirective.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/xembly/XpathDirective.java b/src/main/java/org/xembly/XpathDirective.java index 3caec5b0..d6a654a8 100644 --- a/src/main/java/org/xembly/XpathDirective.java +++ b/src/main/java/org/xembly/XpathDirective.java @@ -58,7 +58,13 @@ final class XpathDirective implements Directive { /** * XPath factory. */ - private static final XPathFactory FACTORY = XPathFactory.newInstance(); + private static final ThreadLocal FACTORY = + new ThreadLocal() { + @Override + protected XPathFactory initialValue() { + return XPathFactory.newInstance(); + } + }; /** * Pattern to match root-only XPath queries. @@ -135,7 +141,7 @@ private static Collection rootOnly(final String root, private static Collection traditional(final String query, final Node dom, final Collection current) throws ImpossibleModificationException { - final XPath xpath = XpathDirective.FACTORY.newXPath(); + final XPath xpath = XpathDirective.FACTORY.get().newXPath(); final Collection targets = new HashSet(0); for (final Node node : XpathDirective.roots(dom, current)) { final NodeList list; From 1a945e4f4b32e028134ba90c317cfb331858adbc Mon Sep 17 00:00:00 2001 From: Carlos Miranda Date: Fri, 10 Aug 2018 13:34:40 +0800 Subject: [PATCH 2/2] #82 Remove Coveralls --- pom.xml | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/pom.xml b/pom.xml index 2ffc8adc..3ceb87ba 100644 --- a/pom.xml +++ b/pom.xml @@ -250,50 +250,5 @@ - - coveralls - - pom.xml - - - - - org.codehaus.mojo - cobertura-maven-plugin - - - site - - cobertura - - - xml - 256m - - - - - - org.eluder.coveralls - coveralls-maven-plugin - 4.1.0 - - - site - - report - - - ${coveralls.token} - - ${project.build.directory}/generated-sources/antlr3 - - - - - - - -