Skip to content

Commit

Permalink
ARIES-697: Use doPriv block in MessageUtil
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/aries/trunk/util@1141867 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Valentin Mahrwald committed Jul 1, 2011
1 parent 91a1def commit b1c1426
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/org/apache/aries/util/nls/MessageUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@ public static MessageUtil createMessageUtil(final Bundle b, String baseName)
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);
Expand Down

0 comments on commit b1c1426

Please sign in to comment.