Github user lukaszlenart commented on a diff in the pull request:

    https://github.com/apache/struts/pull/20#discussion_r15575101
  
    --- Diff: 
xwork-core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java ---
    @@ -136,13 +129,21 @@ public static void setReloadBundles(boolean 
reloadBundles) {
          */
         public static void addDefaultResourceBundle(String resourceBundleName) 
{
             //make sure this doesn't get added more than once
    -        synchronized (DEFAULT_RESOURCE_BUNDLES) {
    -            DEFAULT_RESOURCE_BUNDLES.remove(resourceBundleName);
    -            DEFAULT_RESOURCE_BUNDLES.add(0, resourceBundleName);
    +        ClassLoader ccl = null;
    +        synchronized (classLoaderMap) {
    +            ccl = getThreadCurrentThreadGetContextClassLoader();
    +            List<String> bundles = classLoaderMap.get(ccl.hashCode());
    +            if (bundles == null) {
    +                bundles = new ArrayList<String>();
    +                classLoaderMap.put(ccl.hashCode(), bundles);
    +                bundles.add(XWORK_MESSAGES_BUNDLE);
    +            }
    +            bundles.remove(resourceBundleName);
    +            bundles.add(0, resourceBundleName);
             }
     
             if (LOG.isDebugEnabled()) {
    -            LOG.debug("Added default resource bundle '" + 
resourceBundleName + "' to default resource bundles = " + 
DEFAULT_RESOURCE_BUNDLES);
    +            LOG.debug("Added default resource bundle '" + 
resourceBundleName + "' to default resource bundles for the following 
classloader " + ccl.toString());
    --- End diff --
    
    Please use `#0`, `#1` as variable substitution


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to