< prev index next >

src/java.base/share/classes/java/security/cert/X509CRLSelector.java

Print this page

        

@@ -122,12 +122,12 @@
         if ((issuers == null) || issuers.isEmpty()) {
             issuerNames = null;
             issuerX500Principals = null;
         } else {
             // clone
-            issuerX500Principals = new HashSet<X500Principal>(issuers);
-            issuerNames = new HashSet<Object>();
+            issuerX500Principals = new HashSet<>(issuers);
+            issuerNames = new HashSet<>();
             for (X500Principal p : issuerX500Principals) {
                 issuerNames.add(p.getEncoded());
             }
         }
     }

@@ -286,14 +286,14 @@
      * @param principal the name in X500Principal form
      * @throws IOException if a parsing error occurs
      */
     private void addIssuerNameInternal(Object name, X500Principal principal) {
         if (issuerNames == null) {
-            issuerNames = new HashSet<Object>();
+            issuerNames = new HashSet<>();
         }
         if (issuerX500Principals == null) {
-            issuerX500Principals = new HashSet<X500Principal>();
+            issuerX500Principals = new HashSet<>();
         }
         issuerNames.add(name);
         issuerX500Principals.add(principal);
     }
 

@@ -309,11 +309,11 @@
      * @throws IOException if a parsing error occurs
      */
     private static HashSet<Object> cloneAndCheckIssuerNames(Collection<?> names)
         throws IOException
     {
-        HashSet<Object> namesCopy = new HashSet<Object>();
+        HashSet<Object> namesCopy = new HashSet<>();
         Iterator<?> i = names.iterator();
         while (i.hasNext()) {
             Object nameObject = i.next();
             if (!(nameObject instanceof byte []) &&
                 !(nameObject instanceof String))

@@ -361,11 +361,11 @@
      * @return a HashSet of issuerX500Principals
      * @throws IOException if a parsing error occurs
      */
     private static HashSet<X500Principal> parseIssuerNames(Collection<Object> names)
     throws IOException {
-        HashSet<X500Principal> x500Principals = new HashSet<X500Principal>();
+        HashSet<X500Principal> x500Principals = new HashSet<>();
         for (Iterator<Object> t = names.iterator(); t.hasNext(); ) {
             Object nameObject = t.next();
             if (nameObject instanceof String) {
                 x500Principals.add(new X500Name((String)nameObject).asX500Principal());
             } else {

@@ -699,13 +699,13 @@
     public Object clone() {
         try {
             X509CRLSelector copy = (X509CRLSelector)super.clone();
             if (issuerNames != null) {
                 copy.issuerNames =
-                        new HashSet<Object>(issuerNames);
+                        new HashSet<>(issuerNames);
                 copy.issuerX500Principals =
-                        new HashSet<X500Principal>(issuerX500Principals);
+                        new HashSet<>(issuerX500Principals);
             }
             return copy;
         } catch (CloneNotSupportedException e) {
             /* Cannot happen */
             throw new InternalError(e.toString(), e);
< prev index next >