Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Aug 10, 2018
2 parents 3939de0 + 1a945e4 commit 664a3ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 47 deletions.
45 changes: 0 additions & 45 deletions pom.xml
Expand Up @@ -250,50 +250,5 @@
</plugins>
</build>
</profile>
<profile>
<id>coveralls</id>
<activation>
<file><exists>pom.xml</exists></file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<executions>
<execution>
<phase>site</phase>
<goals>
<goal>cobertura</goal>
</goals>
<configuration>
<format>xml</format>
<maxmem>256m</maxmem>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.1.0</version>
<executions>
<execution>
<phase>site</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<repoToken>${coveralls.token}</repoToken>
<sourceDirectories>
<dir>${project.build.directory}/generated-sources/antlr3</dir>
</sourceDirectories>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
10 changes: 8 additions & 2 deletions src/main/java/org/xembly/XpathDirective.java
Expand Up @@ -58,7 +58,13 @@ final class XpathDirective implements Directive {
/**
* XPath factory.
*/
private static final XPathFactory FACTORY = XPathFactory.newInstance();
private static final ThreadLocal<XPathFactory> FACTORY =
new ThreadLocal<XPathFactory>() {
@Override
protected XPathFactory initialValue() {
return XPathFactory.newInstance();
}
};

/**
* Pattern to match root-only XPath queries.
Expand Down Expand Up @@ -135,7 +141,7 @@ private static Collection<Node> rootOnly(final String root,
private static Collection<Node> traditional(final String query,
final Node dom, final Collection<Node> current)
throws ImpossibleModificationException {
final XPath xpath = XpathDirective.FACTORY.newXPath();
final XPath xpath = XpathDirective.FACTORY.get().newXPath();
final Collection<Node> targets = new HashSet<Node>(0);
for (final Node node : XpathDirective.roots(dom, current)) {
final NodeList list;
Expand Down

0 comments on commit 664a3ce

Please sign in to comment.