src/java.base/share/classes/javax/crypto/Cipher.java
changeset 53018 8bf9268df0e2
parent 52902 e3398b2e1ab0
child 57538 445c32471dc6
equal deleted inserted replaced
53017:e10a1f7aaa13 53018:8bf9268df0e2
   339             }
   339             }
   340         } catch (NoSuchElementException e) {
   340         } catch (NoSuchElementException e) {
   341             throw new NoSuchAlgorithmException("Invalid transformation " +
   341             throw new NoSuchAlgorithmException("Invalid transformation " +
   342                                            "format:" + transformation);
   342                                            "format:" + transformation);
   343         }
   343         }
   344         if ((parts[0] == null) || (parts[0].length() == 0)) {
   344         if ((parts[0] == null) || (parts[0].isEmpty())) {
   345             throw new NoSuchAlgorithmException("Invalid transformation:" +
   345             throw new NoSuchAlgorithmException("Invalid transformation:" +
   346                                    "algorithm not specified-"
   346                                    "algorithm not specified-"
   347                                    + transformation);
   347                                    + transformation);
   348         }
   348         }
   349         return parts;
   349         return parts;
   443         String[] parts = tokenizeTransformation(transformation);
   443         String[] parts = tokenizeTransformation(transformation);
   444 
   444 
   445         String alg = parts[0];
   445         String alg = parts[0];
   446         String mode = parts[1];
   446         String mode = parts[1];
   447         String pad = parts[2];
   447         String pad = parts[2];
   448         if ((mode != null) && (mode.length() == 0)) {
   448         if ((mode != null) && (mode.isEmpty())) {
   449             mode = null;
   449             mode = null;
   450         }
   450         }
   451         if ((pad != null) && (pad.length() == 0)) {
   451         if ((pad != null) && (pad.isEmpty())) {
   452             pad = null;
   452             pad = null;
   453         }
   453         }
   454 
   454 
   455         if ((mode == null) && (pad == null)) {
   455         if ((mode == null) && (pad == null)) {
   456             // AES
   456             // AES
   632             NoSuchPaddingException
   632             NoSuchPaddingException
   633     {
   633     {
   634         if ((transformation == null) || transformation.isEmpty()) {
   634         if ((transformation == null) || transformation.isEmpty()) {
   635             throw new NoSuchAlgorithmException("Null or empty transformation");
   635             throw new NoSuchAlgorithmException("Null or empty transformation");
   636         }
   636         }
   637         if ((provider == null) || (provider.length() == 0)) {
   637         if ((provider == null) || (provider.isEmpty())) {
   638             throw new IllegalArgumentException("Missing provider");
   638             throw new IllegalArgumentException("Missing provider");
   639         }
   639         }
   640         Provider p = Security.getProvider(provider);
   640         Provider p = Security.getProvider(provider);
   641         if (p == null) {
   641         if (p == null) {
   642             throw new NoSuchProviderException("No such provider: " +
   642             throw new NoSuchProviderException("No such provider: " +