8285263: Minor cleanup could be done in java.security

Reviewed-by: weijun
This commit is contained in:
Mark Powers 2022-06-13 15:13:56 +00:00 committed by Weijun Wang
parent b97a4f6cdc
commit 17695962ac
94 changed files with 480 additions and 601 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -99,9 +99,9 @@ public class CertStore {
* </pre>
*/
private static final String CERTSTORE_TYPE = "certstore.type";
private CertStoreSpi storeSpi;
private Provider provider;
private String type;
private final CertStoreSpi storeSpi;
private final Provider provider;
private final String type;
private CertStoreParameters params;
/**
@ -207,7 +207,7 @@ public class CertStore {
* {@code jdk.security.provider.preferred}
* {@link Security#getProperty(String) Security} property to determine
* the preferred provider order for the specified algorithm. This
* may be different than the order of providers returned by
* may be different from the order of providers returned by
* {@link Security#getProviders() Security.getProviders()}.
*
* @param type the name of the requested {@code CertStore} type.
@ -427,13 +427,10 @@ public class CertStore {
* {@literal "LDAP"} if no such property exists.
*/
@SuppressWarnings("removal")
public static final String getDefaultType() {
public static String getDefaultType() {
String cstype;
cstype = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
return Security.getProperty(CERTSTORE_TYPE);
}
});
cstype = AccessController.doPrivileged((PrivilegedAction<String>) () ->
Security.getProperty(CERTSTORE_TYPE));
if (cstype == null) {
cstype = "LDAP";
}