JexlPermissions concrete classes are but since this is an interface, anyone 
could create a non-thread safe instance and use it. The same way a JexlFeatures 
could be corrupted by being constructed with a non-thread safe namespace 
predicate (making side-effects etc).
And for JexlFeatures, using a concurrent set for reserved names (although a 
strange idea) could be a valid usage (counting the number of times a var name 
is declared for instance).

Back to your question, both of them are *expected* to be thread-safe if you 
want to use the same JexlEngine and JexlScript across threads. There is no way 
to ensure this and I suppose altering documentation would not ease your worry.


On 2023/10/20 16:26:30 sebb wrote:
> Are instances of the classes JexlFeatures and JexlPermissions intended
> to be thread-safe?
> 
> I have seen mention that they can be shared between threads.
> 
> However JexlFeatures is does not appear to be thread-safe (has mutable
> fields which are not safely published). Not looked at JexlPermissions
> in detail.
> 
> Sebb
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to