8267543: Post JEP 411 refactoring: security

Reviewed-by: mullan
This commit is contained in:
Weijun Wang 2021-06-02 15:47:57 +00:00
parent 476775808f
commit 40d23a0c0b
19 changed files with 80 additions and 79 deletions

View file

@ -160,7 +160,7 @@ final class ProviderConfig {
/**
* Get the provider object. Loads the provider if it is not already loaded.
*/
@SuppressWarnings({"removal","deprecation"})
@SuppressWarnings("deprecation")
Provider getProvider() {
// volatile variable load
Provider p = provider;
@ -188,7 +188,8 @@ final class ProviderConfig {
p = new sun.security.ssl.SunJSSE();
} else if (provName.equals("Apple") || provName.equals("apple.security.AppleProvider")) {
// need to use reflection since this class only exists on MacOsx
p = AccessController.doPrivileged(new PrivilegedAction<Provider>() {
@SuppressWarnings("removal")
var tmp = AccessController.doPrivileged(new PrivilegedAction<Provider>() {
public Provider run() {
try {
Class<?> c = Class.forName("apple.security.AppleProvider");
@ -208,6 +209,7 @@ final class ProviderConfig {
}
}
});
p = tmp;
} else {
if (isLoading) {
// because this method is synchronized, this can only