deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject [1/7] git commit: DELTASPIKE-386 use correct ClassLoader for loading the ResourceBundle
Date Sun, 23 Jun 2013 21:09:36 GMT
Updated Branches:
  refs/heads/master 9c301fc28 -> ec592a451


DELTASPIKE-386 use correct ClassLoader for loading the ResourceBundle

txs to Richard DiCroce for the catch!


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/01b87451
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/01b87451
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/01b87451

Branch: refs/heads/master
Commit: 01b87451db42627e908f3f9c900aba9a7620f891
Parents: 9c301fc
Author: Mark Struberg <struberg@apache.org>
Authored: Sun Jun 23 17:19:06 2013 +0200
Committer: Mark Struberg <struberg@apache.org>
Committed: Sun Jun 23 17:19:06 2013 +0200

----------------------------------------------------------------------
 .../apache/deltaspike/core/util/PropertyFileUtils.java   | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/01b87451/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/PropertyFileUtils.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/PropertyFileUtils.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/PropertyFileUtils.java
index 80b7fc7..fabba11 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/PropertyFileUtils.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/PropertyFileUtils.java
@@ -90,13 +90,20 @@ public abstract class PropertyFileUtils
         return props;
     }
 
+    /**
+     * @return the ResourceBundle for the current default Locale
+     */
     public static ResourceBundle getResourceBundle(String bundleName)
     {
         return getResourceBundle(bundleName, Locale.getDefault());
     }
 
+    /**
+     * This uses the correct ThreadContextClassLoader if deployed in an Container.
+     * @return the ResourceBundle for the current Locale
+     */
     public static ResourceBundle getResourceBundle(String bundleName, Locale locale)
     {
-        return ResourceBundle.getBundle(bundleName, locale);
+        return ResourceBundle.getBundle(bundleName, locale, ClassUtils.getClassLoader(null));
     }
-}
\ No newline at end of file
+}


Mime
View raw message