phax / ph-schematron

Java Schematron library that supports XSLT and native application
Apache License 2.0
116 stars 36 forks source link

Fix variable values thread safety in pure mode #183

Open bertrand-lorentz opened 3 weeks ago

bertrand-lorentz commented 3 weeks ago

Fix issue #182 by storing variable values in a ThreadLocal map, and add a unit test to check for this.

This might not be a perfect fix, but it seems to do the trick.

After this change, the compiled XPaths for the variable values are still potentially used from multiple threads, and XPathExpression is indicated as not being thread-safe. But I did not see any easy way to adress this, and this does not seem to cause any problems.