Skip to content

Commit

Permalink
Adding AccessController
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
  • Loading branch information
jbescos committed Feb 22, 2021
1 parent 7bed1a7 commit 7d603d2
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.glassfish.jersey.server.internal.monitoring.core;

import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand Down Expand Up @@ -55,13 +56,7 @@ public Integer run() {
return Integer.getInteger(ServerProperties.COLLISION_BUFFER_POWER_JVM_ARG, DEFAULT_COLLISION_BUFFER_POWER);
}
};
int collisionBuffePower = DEFAULT_COLLISION_BUFFER_POWER;
try {
collisionBuffePower = action.run();
} catch (SecurityException e) {
Logger.getLogger(ReservoirConstants.class.getName()).log(Level.WARNING, e.getLocalizedMessage(), e);
}
COLLISION_BUFFER_POWER = collisionBuffePower;
COLLISION_BUFFER_POWER = AccessController.doPrivileged(action);
COLLISION_BUFFER = 1 << COLLISION_BUFFER_POWER; // 256
}

Expand Down

0 comments on commit 7d603d2

Please sign in to comment.