< prev index next >

src/java.base/share/classes/java/security/cert/CertPathValidator.java

Print this page
rev 15967 : [mq]: GetInstance

*** 30,40 **** import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.PrivilegedAction; import java.security.Provider; import java.security.Security; ! import sun.security.util.Debug; import sun.security.jca.*; import sun.security.jca.GetInstance.Instance; /** --- 30,40 ---- import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.PrivilegedAction; import java.security.Provider; import java.security.Security; ! import java.util.Objects; import sun.security.jca.*; import sun.security.jca.GetInstance.Instance; /**
*** 156,175 **** * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathValidator"> * Java Cryptography Architecture Standard Algorithm Name Documentation</a> * for information about standard algorithm names. * * @return a {@code CertPathValidator} object that implements the ! * specified algorithm. * ! * @exception NoSuchAlgorithmException if no Provider supports a ! * CertPathValidatorSpi implementation for the ! * specified algorithm. * * @see java.security.Provider */ public static CertPathValidator getInstance(String algorithm) throws NoSuchAlgorithmException { Instance instance = GetInstance.getInstance("CertPathValidator", CertPathValidatorSpi.class, algorithm); return new CertPathValidator((CertPathValidatorSpi)instance.impl, instance.provider, algorithm); } --- 156,178 ---- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathValidator"> * Java Cryptography Architecture Standard Algorithm Name Documentation</a> * for information about standard algorithm names. * * @return a {@code CertPathValidator} object that implements the ! * specified algorithm * ! * @throws NoSuchAlgorithmException if no {@code Provider} supports a ! * {@code CertPathValidatorSpi} implementation for the ! * specified algorithm ! * ! * @throws NullPointerException if {@code algorithm} is {@code null} * * @see java.security.Provider */ public static CertPathValidator getInstance(String algorithm) throws NoSuchAlgorithmException { + Objects.requireNonNull(algorithm, "null algorithm name"); Instance instance = GetInstance.getInstance("CertPathValidator", CertPathValidatorSpi.class, algorithm); return new CertPathValidator((CertPathValidatorSpi)instance.impl, instance.provider, algorithm); }
*** 193,219 **** * for information about standard algorithm names. * * @param provider the name of the provider. * * @return a {@code CertPathValidator} object that implements the ! * specified algorithm. * ! * @exception NoSuchAlgorithmException if a CertPathValidatorSpi * implementation for the specified algorithm is not ! * available from the specified provider. * ! * @exception NoSuchProviderException if the specified provider is not ! * registered in the security provider list. * ! * @exception IllegalArgumentException if the {@code provider} is ! * null or empty. * * @see java.security.Provider */ public static CertPathValidator getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException { Instance instance = GetInstance.getInstance("CertPathValidator", CertPathValidatorSpi.class, algorithm, provider); return new CertPathValidator((CertPathValidatorSpi)instance.impl, instance.provider, algorithm); } --- 196,225 ---- * for information about standard algorithm names. * * @param provider the name of the provider. * * @return a {@code CertPathValidator} object that implements the ! * specified algorithm * ! * @throws IllegalArgumentException if the {@code provider} is ! * {@code null} or empty ! * ! * @throws NoSuchAlgorithmException if a {@code CertPathValidatorSpi} * 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 CertPathValidator getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException { + Objects.requireNonNull(algorithm, "null algorithm name"); Instance instance = GetInstance.getInstance("CertPathValidator", CertPathValidatorSpi.class, algorithm, provider); return new CertPathValidator((CertPathValidatorSpi)instance.impl, instance.provider, algorithm); }
*** 234,256 **** * for information about standard algorithm names. * * @param provider the provider. * * @return a {@code CertPathValidator} object that implements the ! * specified algorithm. * ! * @exception NoSuchAlgorithmException if a CertPathValidatorSpi * implementation for the specified algorithm is not available ! * from the specified Provider object. * ! * @exception IllegalArgumentException if the {@code provider} is ! * null. * * @see java.security.Provider */ public static CertPathValidator getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { Instance instance = GetInstance.getInstance("CertPathValidator", CertPathValidatorSpi.class, algorithm, provider); return new CertPathValidator((CertPathValidatorSpi)instance.impl, instance.provider, algorithm); } --- 240,265 ---- * for information about standard algorithm names. * * @param provider the provider. * * @return a {@code CertPathValidator} object that implements the ! * specified algorithm ! * ! * @throws IllegalArgumentException if the {@code provider} is ! * {@code null} * ! * @throws NoSuchAlgorithmException if a {@code CertPathValidatorSpi} * implementation for the specified algorithm is not available ! * from the specified Provider object * ! * @throws NullPointerException if {@code algorithm} is {@code null} * * @see java.security.Provider */ public static CertPathValidator getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { + Objects.requireNonNull(algorithm, "null algorithm name"); Instance instance = GetInstance.getInstance("CertPathValidator", CertPathValidatorSpi.class, algorithm, provider); return new CertPathValidator((CertPathValidatorSpi)instance.impl, instance.provider, algorithm); }
< prev index next >