< prev index next >

src/java.base/share/classes/java/security/cert/CertPathBuilder.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; /**
*** 155,174 **** * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathBuilder"> * Java Cryptography Architecture Standard Algorithm Name Documentation</a> * for information about standard algorithm names. * * @return a {@code CertPathBuilder} object that implements the ! * specified algorithm. * ! * @throws NoSuchAlgorithmException if no Provider supports a ! * CertPathBuilderSpi implementation for the ! * specified algorithm. * * @see java.security.Provider */ public static CertPathBuilder getInstance(String algorithm) throws NoSuchAlgorithmException { Instance instance = GetInstance.getInstance("CertPathBuilder", CertPathBuilderSpi.class, algorithm); return new CertPathBuilder((CertPathBuilderSpi)instance.impl, instance.provider, algorithm); } --- 155,177 ---- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathBuilder"> * Java Cryptography Architecture Standard Algorithm Name Documentation</a> * for information about standard algorithm names. * * @return a {@code CertPathBuilder} object that implements the ! * specified algorithm * ! * @throws NoSuchAlgorithmException if no {@code Provider} supports a ! * {@code CertPathBuilderSpi} implementation for the ! * specified algorithm ! * ! * @throws NullPointerException if {@code algorithm} is {@code null} * * @see java.security.Provider */ public static CertPathBuilder getInstance(String algorithm) throws NoSuchAlgorithmException { + Objects.requireNonNull(algorithm, "null algorithm name"); Instance instance = GetInstance.getInstance("CertPathBuilder", CertPathBuilderSpi.class, algorithm); return new CertPathBuilder((CertPathBuilderSpi)instance.impl, instance.provider, algorithm); }
*** 192,217 **** * for information about standard algorithm names. * * @param provider the name of the provider. * * @return a {@code CertPathBuilder} object that implements the ! * specified algorithm. * ! * @throws NoSuchAlgorithmException if a CertPathBuilderSpi * 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. * ! * @exception IllegalArgumentException if the {@code provider} is ! * null or empty. * * @see java.security.Provider */ public static CertPathBuilder getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException { Instance instance = GetInstance.getInstance("CertPathBuilder", CertPathBuilderSpi.class, algorithm, provider); return new CertPathBuilder((CertPathBuilderSpi)instance.impl, instance.provider, algorithm); } --- 195,223 ---- * for information about standard algorithm names. * * @param provider the name of the provider. * * @return a {@code CertPathBuilder} object that implements the ! * specified algorithm * ! * @throws IllegalArgumentException if the {@code provider} is ! * {@code null} or empty ! * ! * @throws NoSuchAlgorithmException if a {@code CertPathBuilderSpi} * 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 CertPathBuilder getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException { + Objects.requireNonNull(algorithm, "null algorithm name"); Instance instance = GetInstance.getInstance("CertPathBuilder", CertPathBuilderSpi.class, algorithm, provider); return new CertPathBuilder((CertPathBuilderSpi)instance.impl, instance.provider, algorithm); }
*** 232,254 **** * for information about standard algorithm names. * * @param provider the provider. * * @return a {@code CertPathBuilder} object that implements the ! * specified algorithm. * ! * @exception NoSuchAlgorithmException if a CertPathBuilderSpi * 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 CertPathBuilder getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { Instance instance = GetInstance.getInstance("CertPathBuilder", CertPathBuilderSpi.class, algorithm, provider); return new CertPathBuilder((CertPathBuilderSpi)instance.impl, instance.provider, algorithm); } --- 238,263 ---- * for information about standard algorithm names. * * @param provider the provider. * * @return a {@code CertPathBuilder} object that implements the ! * specified algorithm ! * ! * @throws IllegalArgumentException if the {@code provider} is ! * {@code null} * ! * @throws NoSuchAlgorithmException if a {@code CertPathBuilderSpi} * 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 CertPathBuilder getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { + Objects.requireNonNull(algorithm, "null algorithm name"); Instance instance = GetInstance.getInstance("CertPathBuilder", CertPathBuilderSpi.class, algorithm, provider); return new CertPathBuilder((CertPathBuilderSpi)instance.impl, instance.provider, algorithm); }
< prev index next >