< prev index next >

src/java.base/share/classes/javax/crypto/Cipher.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad

*** 529,539 **** * @see java.security.Provider */ public static final Cipher getInstance(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException { ! if ((transformation == null) || transformation.equals("")) { throw new NoSuchAlgorithmException("Null or empty transformation"); } List<Transform> transforms = getTransforms(transformation); List<ServiceId> cipherServices = new ArrayList<>(transforms.size()); for (Transform transform : transforms) { --- 529,539 ---- * @see java.security.Provider */ public static final Cipher getInstance(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException { ! if ((transformation == null) || transformation.isEmpty()) { throw new NoSuchAlgorithmException("Null or empty transformation"); } List<Transform> transforms = getTransforms(transformation); List<ServiceId> cipherServices = new ArrayList<>(transforms.size()); for (Transform transform : transforms) {
*** 629,639 **** public static final Cipher getInstance(String transformation, String provider) throws NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException { ! if ((transformation == null) || transformation.equals("")) { throw new NoSuchAlgorithmException("Null or empty transformation"); } if ((provider == null) || (provider.length() == 0)) { throw new IllegalArgumentException("Missing provider"); } --- 629,639 ---- public static final Cipher getInstance(String transformation, String provider) throws NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException { ! if ((transformation == null) || transformation.isEmpty()) { throw new NoSuchAlgorithmException("Null or empty transformation"); } if ((provider == null) || (provider.length() == 0)) { throw new IllegalArgumentException("Missing provider"); }
*** 696,706 **** */ public static final Cipher getInstance(String transformation, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException { ! if ((transformation == null) || transformation.equals("")) { throw new NoSuchAlgorithmException("Null or empty transformation"); } if (provider == null) { throw new IllegalArgumentException("Missing provider"); } --- 696,706 ---- */ public static final Cipher getInstance(String transformation, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException { ! if ((transformation == null) || transformation.isEmpty()) { throw new NoSuchAlgorithmException("Null or empty transformation"); } if (provider == null) { throw new IllegalArgumentException("Missing provider"); }
< prev index next >