[ 
https://issues.apache.org/jira/browse/JXPATH-162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benedikt Ritter resolved JXPATH-162.
------------------------------------
    Resolution: Fixed

{code}
$ svn ci -m "JXPATH-162: Concurrency problem for 
JXPathContextFactory.factoryImplName static field. Thanks to Michele Vivoda and 
Uwe Barthel."
Sending        src/changes/changes.xml
Sending        src/main/java/org/apache/commons/jxpath/JXPathContextFactory.java
Transmitting file data ..
Committed revision 1715629.
{code}

Thank you!

Please make sure to follow the general code style of JXPATH and indent code 
with four spaces (the patch was indented with only two spaces).

> 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
>            Assignee: Benedikt Ritter
>            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