src/java.base/share/classes/javax/crypto/Cipher.java
changeset 52902 e3398b2e1ab0
parent 52603 e89a4cbffba0
child 53018 8bf9268df0e2
equal deleted inserted replaced
52901:3ba9ff4d4aaf 52902:e3398b2e1ab0
   529      * @see java.security.Provider
   529      * @see java.security.Provider
   530      */
   530      */
   531     public static final Cipher getInstance(String transformation)
   531     public static final Cipher getInstance(String transformation)
   532             throws NoSuchAlgorithmException, NoSuchPaddingException
   532             throws NoSuchAlgorithmException, NoSuchPaddingException
   533     {
   533     {
   534         if ((transformation == null) || transformation.equals("")) {
   534         if ((transformation == null) || transformation.isEmpty()) {
   535             throw new NoSuchAlgorithmException("Null or empty transformation");
   535             throw new NoSuchAlgorithmException("Null or empty transformation");
   536         }
   536         }
   537         List<Transform> transforms = getTransforms(transformation);
   537         List<Transform> transforms = getTransforms(transformation);
   538         List<ServiceId> cipherServices = new ArrayList<>(transforms.size());
   538         List<ServiceId> cipherServices = new ArrayList<>(transforms.size());
   539         for (Transform transform : transforms) {
   539         for (Transform transform : transforms) {
   629     public static final Cipher getInstance(String transformation,
   629     public static final Cipher getInstance(String transformation,
   630                                            String provider)
   630                                            String provider)
   631             throws NoSuchAlgorithmException, NoSuchProviderException,
   631             throws NoSuchAlgorithmException, NoSuchProviderException,
   632             NoSuchPaddingException
   632             NoSuchPaddingException
   633     {
   633     {
   634         if ((transformation == null) || transformation.equals("")) {
   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.length() == 0)) {
   638             throw new IllegalArgumentException("Missing provider");
   638             throw new IllegalArgumentException("Missing provider");
   639         }
   639         }
   696      */
   696      */
   697     public static final Cipher getInstance(String transformation,
   697     public static final Cipher getInstance(String transformation,
   698                                            Provider provider)
   698                                            Provider provider)
   699             throws NoSuchAlgorithmException, NoSuchPaddingException
   699             throws NoSuchAlgorithmException, NoSuchPaddingException
   700     {
   700     {
   701         if ((transformation == null) || transformation.equals("")) {
   701         if ((transformation == null) || transformation.isEmpty()) {
   702             throw new NoSuchAlgorithmException("Null or empty transformation");
   702             throw new NoSuchAlgorithmException("Null or empty transformation");
   703         }
   703         }
   704         if (provider == null) {
   704         if (provider == null) {
   705             throw new IllegalArgumentException("Missing provider");
   705             throw new IllegalArgumentException("Missing provider");
   706         }
   706         }