Skip to content

Commit

Permalink
Merge pull request #64 from garcia-jj/ot-generics4privilegedaction
Browse files Browse the repository at this point in the history
PrivilegedAction can executed with generics. The generics use is inside the methods and does not change the external interface.
  • Loading branch information
mattbishop committed Sep 26, 2014
2 parents 1909792 + ff61dda commit b0afabb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -674,8 +674,8 @@ private static ClassLoader getContextClassLoader() {
}

private static InputStream getResourceAsStream(final String name) {
return (InputStream) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
public InputStream run() {
ClassLoader threadCL = getContextClassLoader();

if (threadCL != null) {
Expand Down
6 changes: 3 additions & 3 deletions slf4j-simple/src/main/java/org/slf4j/impl/SimpleLogger.java
Expand Up @@ -233,9 +233,9 @@ else if ("System.out".equalsIgnoreCase(logFile)) {

private static void loadProperties() {
// Add props from the resource simplelogger.properties
InputStream in = (InputStream) AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
InputStream in = AccessController.doPrivileged(
new PrivilegedAction<InputStream>() {
public InputStream run() {
ClassLoader threadCL = Thread.currentThread().getContextClassLoader();
if (threadCL != null) {
return threadCL.getResourceAsStream(CONFIGURATION_FILE);
Expand Down

0 comments on commit b0afabb

Please sign in to comment.