aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahrw...@apache.org
Subject svn commit: r1141867 - /aries/trunk/util/src/main/java/org/apache/aries/util/nls/MessageUtil.java
Date Fri, 01 Jul 2011 08:32:08 GMT
Author: mahrwald
Date: Fri Jul  1 08:32:08 2011
New Revision: 1141867

URL: http://svn.apache.org/viewvc?rev=1141867&view=rev
Log:
ARIES-697: Use doPriv block in MessageUtil

Modified:
    aries/trunk/util/src/main/java/org/apache/aries/util/nls/MessageUtil.java

Modified: aries/trunk/util/src/main/java/org/apache/aries/util/nls/MessageUtil.java
URL: http://svn.apache.org/viewvc/aries/trunk/util/src/main/java/org/apache/aries/util/nls/MessageUtil.java?rev=1141867&r1=1141866&r2=1141867&view=diff
==============================================================================
--- aries/trunk/util/src/main/java/org/apache/aries/util/nls/MessageUtil.java (original)
+++ aries/trunk/util/src/main/java/org/apache/aries/util/nls/MessageUtil.java Fri Jul  1 08:32:08
2011
@@ -144,7 +144,12 @@ public final class MessageUtil
       rb = ResourceBundle.getBundle(baseName);
     } else {
       // if the bundle is OSGi use OSGi resolve rules as best as Java5 allows
-      rb = ResourceBundle.getBundle(baseName, Locale.getDefault(), AriesFrameworkUtil.getClassLoader(b));
+      ClassLoader loader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
{
+        public ClassLoader run() {
+            return AriesFrameworkUtil.getClassLoader(b);
+        }          
+      }); 
+      rb = ResourceBundle.getBundle(baseName, Locale.getDefault(), loader);
     }
     
     return new MessageUtil(rb);



Mime
View raw message