[ 
https://issues.apache.org/jira/browse/JXPATH-162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15020371#comment-15020371
 ] 

Uwe Barthel commented on JXPATH-162:
------------------------------------

Open pull request: [JXPATH-162: Find the factory implementation name in the 
static initializer|https://github.com/apache/commons-jxpath/pull/10].

Following the suggestion of [[email protected]].

> Concurrency problem for JXPathContextFactory.factoryImplName static field
> -------------------------------------------------------------------------
>
>                 Key: JXPATH-162
>                 URL: https://issues.apache.org/jira/browse/JXPATH-162
>             Project: Commons JXPath
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Michele Vivoda
>            Priority: Minor
>             Fix For: 1.4
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> The static field [factoryImplName] is loaded lazily when the first call to 
> JXPathContextFactory#getInstance() is made. This is a broken pattern when 
> #getInstance() is called by multiple threads. My suggestion is to find the 
> name in the static initializer:
> private static final String factoryImplName = 
> findFactory(FACTORY_NAME_PROPERTY, DEFAULT_FACTORY_CLASS);
>     



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to