< prev index next >
src/java.base/share/classes/javax/net/ssl/TrustManagerFactory.java
Print this page
rev 15967 : [mq]: GetInstance
*** 25,34 ****
--- 25,35 ----
package javax.net.ssl;
import java.security.Security;
import java.security.*;
+ import java.util.Objects;
import sun.security.jca.GetInstance;
/**
* This class acts as a factory for trust managers based on a
*** 142,162 ****
* algorithm. See the <a href=
* "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
! * @return the new <code>TrustManagerFactory</code> object.
*
! * @exception NoSuchAlgorithmException if no Provider supports a
! * TrustManagerFactorySpi implementation for the
! * specified algorithm.
! * @exception NullPointerException if algorithm is null.
*
* @see java.security.Provider
*/
public static final TrustManagerFactory getInstance(String algorithm)
throws NoSuchAlgorithmException {
GetInstance.Instance instance = GetInstance.getInstance
("TrustManagerFactory", TrustManagerFactorySpi.class,
algorithm);
return new TrustManagerFactory((TrustManagerFactorySpi)instance.impl,
instance.provider, algorithm);
--- 143,165 ----
* algorithm. See the <a href=
* "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
! * @return the new {@code TrustManagerFactory} object
*
! * @throws NoSuchAlgorithmException if no {@code Provider} supports a
! * {@code TrustManagerFactorySpi} implementation for the
! * specified algorithm
! *
! * @throws NullPointerException if {@code algorithm} is {@code null}
*
* @see java.security.Provider
*/
public static final TrustManagerFactory getInstance(String algorithm)
throws NoSuchAlgorithmException {
+ Objects.requireNonNull(algorithm, "null algorithm name");
GetInstance.Instance instance = GetInstance.getInstance
("TrustManagerFactory", TrustManagerFactorySpi.class,
algorithm);
return new TrustManagerFactory((TrustManagerFactorySpi)instance.impl,
instance.provider, algorithm);
*** 180,206 ****
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
* @param provider the name of the provider.
*
! * @return the new <code>TrustManagerFactory</code> object
*
! * @throws NoSuchAlgorithmException if a TrustManagerFactorySpi
* implementation for the specified algorithm is not
! * available from the specified provider.
*
* @throws NoSuchProviderException if the specified provider is not
! * registered in the security provider list.
*
! * @throws IllegalArgumentException if the provider name is null or empty.
! * @throws NullPointerException if algorithm is null.
*
* @see java.security.Provider
*/
public static final TrustManagerFactory getInstance(String algorithm,
String provider) throws NoSuchAlgorithmException,
NoSuchProviderException {
GetInstance.Instance instance = GetInstance.getInstance
("TrustManagerFactory", TrustManagerFactorySpi.class,
algorithm, provider);
return new TrustManagerFactory((TrustManagerFactorySpi)instance.impl,
instance.provider, algorithm);
--- 183,212 ----
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
* @param provider the name of the provider.
*
! * @return the new {@code TrustManagerFactory} object
! *
! * @throws IllegalArgumentException if the provider name is
! * {@code null} or empty
*
! * @throws NoSuchAlgorithmException if a {@code TrustManagerFactorySpi}
* implementation for the specified algorithm is not
! * available from the specified provider
*
* @throws NoSuchProviderException if the specified provider is not
! * registered in the security provider list
*
! * @throws NullPointerException if {@code algorithm} is {@code null}
*
* @see java.security.Provider
*/
public static final TrustManagerFactory getInstance(String algorithm,
String provider) throws NoSuchAlgorithmException,
NoSuchProviderException {
+ Objects.requireNonNull(algorithm, "null algorithm name");
GetInstance.Instance instance = GetInstance.getInstance
("TrustManagerFactory", TrustManagerFactorySpi.class,
algorithm, provider);
return new TrustManagerFactory((TrustManagerFactorySpi)instance.impl,
instance.provider, algorithm);
*** 221,243 ****
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
* @param provider an instance of the provider.
*
! * @return the new <code>TrustManagerFactory</code> object.
*
! * @throws NoSuchAlgorithmException if a TrustManagerFactorySpi
* implementation for the specified algorithm is not available
! * from the specified Provider object.
*
! * @throws IllegalArgumentException if the provider is null.
! * @throws NullPointerException if algorithm is null.
*
* @see java.security.Provider
*/
public static final TrustManagerFactory getInstance(String algorithm,
Provider provider) throws NoSuchAlgorithmException {
GetInstance.Instance instance = GetInstance.getInstance
("TrustManagerFactory", TrustManagerFactorySpi.class,
algorithm, provider);
return new TrustManagerFactory((TrustManagerFactorySpi)instance.impl,
instance.provider, algorithm);
--- 227,251 ----
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
* @param provider an instance of the provider.
*
! * @return the new {@code TrustManagerFactory} object
! *
! * @throws IllegalArgumentException if the provider is {@code null}
*
! * @throws NoSuchAlgorithmException if a {@code TrustManagerFactorySpi}
* implementation for the specified algorithm is not available
! * from the specified {@code Provider} object
*
! * @throws NullPointerException if {@code algorithm} is {@code null}
*
* @see java.security.Provider
*/
public static final TrustManagerFactory getInstance(String algorithm,
Provider provider) throws NoSuchAlgorithmException {
+ Objects.requireNonNull(algorithm, "null algorithm name");
GetInstance.Instance instance = GetInstance.getInstance
("TrustManagerFactory", TrustManagerFactorySpi.class,
algorithm, provider);
return new TrustManagerFactory((TrustManagerFactorySpi)instance.impl,
instance.provider, algorithm);
< prev index next >