jdk/src/java.base/share/classes/java/security/cert/PKIXParameters.java
changeset 30033 b9c86c17164a
parent 25859 3317bb8137f4
--- a/jdk/src/java.base/share/classes/java/security/cert/PKIXParameters.java	Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/PKIXParameters.java	Thu Apr 23 18:51:18 2015 -0700
@@ -120,8 +120,8 @@
         setTrustAnchors(trustAnchors);
 
         this.unmodInitialPolicies = Collections.<String>emptySet();
-        this.certPathCheckers = new ArrayList<PKIXCertPathChecker>();
-        this.certStores = new ArrayList<CertStore>();
+        this.certPathCheckers = new ArrayList<>();
+        this.certStores = new ArrayList<>();
     }
 
     /**
@@ -144,7 +144,7 @@
         if (keystore == null)
             throw new NullPointerException("the keystore parameter must be " +
                 "non-null");
-        Set<TrustAnchor> hashSet = new HashSet<TrustAnchor>();
+        Set<TrustAnchor> hashSet = new HashSet<>();
         Enumeration<String> aliases = keystore.aliases();
         while (aliases.hasMoreElements()) {
             String alias = aliases.nextElement();
@@ -156,8 +156,8 @@
         }
         setTrustAnchors(hashSet);
         this.unmodInitialPolicies = Collections.<String>emptySet();
-        this.certPathCheckers = new ArrayList<PKIXCertPathChecker>();
-        this.certStores = new ArrayList<CertStore>();
+        this.certPathCheckers = new ArrayList<>();
+        this.certStores = new ArrayList<>();
     }
 
     /**
@@ -207,7 +207,7 @@
             }
         }
         this.unmodTrustAnchors = Collections.unmodifiableSet
-                (new HashSet<TrustAnchor>(trustAnchors));
+                (new HashSet<>(trustAnchors));
     }
 
     /**
@@ -256,7 +256,7 @@
                         + "of type java.lang.String");
             }
             this.unmodInitialPolicies =
-                Collections.unmodifiableSet(new HashSet<String>(initialPolicies));
+                Collections.unmodifiableSet(new HashSet<>(initialPolicies));
         } else
             this.unmodInitialPolicies = Collections.<String>emptySet();
     }
@@ -280,7 +280,7 @@
      */
     public void setCertStores(List<CertStore> stores) {
         if (stores == null) {
-            this.certStores = new ArrayList<CertStore>();
+            this.certStores = new ArrayList<>();
         } else {
             for (Iterator<CertStore> i = stores.iterator(); i.hasNext();) {
                 if (!(i.next() instanceof CertStore)) {
@@ -288,7 +288,7 @@
                         + "of type java.security.cert.CertStore");
                 }
             }
-            this.certStores = new ArrayList<CertStore>(stores);
+            this.certStores = new ArrayList<>(stores);
         }
     }
 
@@ -316,7 +316,7 @@
      */
     public List<CertStore> getCertStores() {
         return Collections.unmodifiableList
-                (new ArrayList<CertStore>(this.certStores));
+                (new ArrayList<>(this.certStores));
     }
 
     /**
@@ -544,14 +544,13 @@
      */
     public void setCertPathCheckers(List<PKIXCertPathChecker> checkers) {
         if (checkers != null) {
-            List<PKIXCertPathChecker> tmpList =
-                        new ArrayList<PKIXCertPathChecker>();
+            List<PKIXCertPathChecker> tmpList = new ArrayList<>();
             for (PKIXCertPathChecker checker : checkers) {
                 tmpList.add((PKIXCertPathChecker)checker.clone());
             }
             this.certPathCheckers = tmpList;
         } else {
-            this.certPathCheckers = new ArrayList<PKIXCertPathChecker>();
+            this.certPathCheckers = new ArrayList<>();
         }
     }
 
@@ -567,7 +566,7 @@
      * @see #setCertPathCheckers
      */
     public List<PKIXCertPathChecker> getCertPathCheckers() {
-        List<PKIXCertPathChecker> tmpList = new ArrayList<PKIXCertPathChecker>();
+        List<PKIXCertPathChecker> tmpList = new ArrayList<>();
         for (PKIXCertPathChecker ck : certPathCheckers) {
             tmpList.add((PKIXCertPathChecker)ck.clone());
         }
@@ -667,11 +666,11 @@
 
             // must clone these because addCertStore, et al. modify them
             if (certStores != null) {
-                copy.certStores = new ArrayList<CertStore>(certStores);
+                copy.certStores = new ArrayList<>(certStores);
             }
             if (certPathCheckers != null) {
                 copy.certPathCheckers =
-                    new ArrayList<PKIXCertPathChecker>(certPathCheckers.size());
+                    new ArrayList<>(certPathCheckers.size());
                 for (PKIXCertPathChecker checker : certPathCheckers) {
                     copy.certPathCheckers.add(
                                     (PKIXCertPathChecker)checker.clone());