< prev index next >

src/java.base/share/classes/java/security/Signature.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD

*** 358,368 **** public static Signature getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException { Objects.requireNonNull(algorithm, "null algorithm name"); if (algorithm.equalsIgnoreCase(RSA_SIGNATURE)) { // exception compatibility with existing code ! if ((provider == null) || (provider.length() == 0)) { throw new IllegalArgumentException("missing provider"); } Provider p = Security.getProvider(provider); if (p == null) { throw new NoSuchProviderException --- 358,368 ---- public static Signature getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException { Objects.requireNonNull(algorithm, "null algorithm name"); if (algorithm.equalsIgnoreCase(RSA_SIGNATURE)) { // exception compatibility with existing code ! if (provider == null || provider.isEmpty()) { throw new IllegalArgumentException("missing provider"); } Provider p = Security.getProvider(provider); if (p == null) { throw new NoSuchProviderException
< prev index next >