mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8209416: Refactoring GetPropertyAction calls in security libs
Reviewed-by: xuelei, rriggs
This commit is contained in:
parent
815cdefb43
commit
33a96c6df9
29 changed files with 146 additions and 196 deletions
|
@ -31,6 +31,8 @@ import java.util.Enumeration;
|
|||
import java.util.Locale;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.SSLSessionContext;
|
||||
|
||||
import sun.security.action.GetPropertyAction;
|
||||
import sun.security.util.Cache;
|
||||
|
||||
|
||||
|
@ -196,15 +198,9 @@ final class SSLSessionContextImpl implements SSLSessionContext {
|
|||
private static int getDefaultCacheLimit() {
|
||||
int defaultCacheLimit = 0;
|
||||
try {
|
||||
String s = java.security.AccessController.doPrivileged(
|
||||
new java.security.PrivilegedAction<String>() {
|
||||
@Override
|
||||
public String run() {
|
||||
return System.getProperty(
|
||||
"javax.net.ssl.sessionCacheSize");
|
||||
}
|
||||
});
|
||||
defaultCacheLimit = (s != null) ? Integer.parseInt(s) : 0;
|
||||
String s = GetPropertyAction
|
||||
.privilegedGetProperty("javax.net.ssl.sessionCacheSize");
|
||||
defaultCacheLimit = (s != null) ? Integer.parseInt(s) : 0;
|
||||
} catch (Exception e) {
|
||||
// swallow the exception
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue