--- old/src/java.base/share/classes/java/security/cert/X509CertSelector.java 2015-04-23 15:28:19.348132706 -0700 +++ new/src/java.base/share/classes/java/security/cert/X509CertSelector.java 2015-04-23 15:28:19.012132698 -0700 @@ -619,8 +619,8 @@ keyPurposeOIDSet = null; } else { this.keyPurposeSet = - Collections.unmodifiableSet(new HashSet(keyPurposeSet)); - keyPurposeOIDSet = new HashSet(); + Collections.unmodifiableSet(new HashSet<>(keyPurposeSet)); + keyPurposeOIDSet = new HashSet<>(); for (String s : this.keyPurposeSet) { keyPurposeOIDSet.add(new ObjectIdentifier(s)); } @@ -815,12 +815,12 @@ // First, ensure that the name parses GeneralNameInterface tempName = makeGeneralNameInterface(type, name); if (subjectAlternativeNames == null) { - subjectAlternativeNames = new HashSet>(); + subjectAlternativeNames = new HashSet<>(); } if (subjectAlternativeGeneralNames == null) { - subjectAlternativeGeneralNames = new HashSet(); + subjectAlternativeGeneralNames = new HashSet<>(); } - List list = new ArrayList(2); + List list = new ArrayList<>(2); list.add(Integer.valueOf(type)); list.add(name); subjectAlternativeNames.add(list); @@ -845,7 +845,7 @@ * @throws IOException if a parsing error occurs */ private static Set parseNames(Collection> names) throws IOException { - Set genNames = new HashSet(); + Set genNames = new HashSet<>(); for (List nameList : names) { if (nameList.size() != 2) { throw new IOException("name list size not 2"); @@ -1096,10 +1096,10 @@ } else { // Snapshot set and parse it Set tempSet = Collections.unmodifiableSet - (new HashSet(certPolicySet)); + (new HashSet<>(certPolicySet)); /* Convert to Vector of ObjectIdentifiers */ Iterator i = tempSet.iterator(); - Vector polIdVector = new Vector(); + Vector polIdVector = new Vector<>(); while (i.hasNext()) { Object o = i.next(); if (!(o instanceof String)) { @@ -1267,10 +1267,10 @@ // First, ensure that the name parses GeneralNameInterface tempName = makeGeneralNameInterface(type, name); if (pathToGeneralNames == null) { - pathToNames = new HashSet>(); - pathToGeneralNames = new HashSet(); + pathToNames = new HashSet<>(); + pathToGeneralNames = new HashSet<>(); } - List list = new ArrayList(2); + List list = new ArrayList<>(2); list.add(Integer.valueOf(type)); list.add(name); pathToNames.add(list); @@ -1671,10 +1671,10 @@ */ private static Set> cloneAndCheckNames(Collection> names) throws IOException { // Copy the Lists and Collection - Set> namesCopy = new HashSet>(); + Set> namesCopy = new HashSet<>(); for (List o : names) { - namesCopy.add(new ArrayList(o)); + namesCopy.add(new ArrayList<>(o)); } // Check the contents of the Lists and clone any byte arrays @@ -2397,7 +2397,7 @@ * Convert the Vector of PolicyInformation to a Vector * of CertificatePolicyIds for easier comparison. */ - List policyIDs = new ArrayList(policies.size()); + List policyIDs = new ArrayList<>(policies.size()); for (PolicyInformation info : policies) { policyIDs.add(info.getPolicyIdentifier()); }