< prev index next >

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

Print this page

        

*** 617,628 **** if ((keyPurposeSet == null) || keyPurposeSet.isEmpty()) { this.keyPurposeSet = null; keyPurposeOIDSet = null; } else { this.keyPurposeSet = ! Collections.unmodifiableSet(new HashSet<String>(keyPurposeSet)); ! keyPurposeOIDSet = new HashSet<ObjectIdentifier>(); for (String s : this.keyPurposeSet) { keyPurposeOIDSet.add(new ObjectIdentifier(s)); } } } --- 617,628 ---- if ((keyPurposeSet == null) || keyPurposeSet.isEmpty()) { this.keyPurposeSet = null; keyPurposeOIDSet = null; } else { this.keyPurposeSet = ! Collections.unmodifiableSet(new HashSet<>(keyPurposeSet)); ! keyPurposeOIDSet = new HashSet<>(); for (String s : this.keyPurposeSet) { keyPurposeOIDSet.add(new ObjectIdentifier(s)); } } }
*** 813,828 **** private void addSubjectAlternativeNameInternal(int type, Object name) throws IOException { // First, ensure that the name parses GeneralNameInterface tempName = makeGeneralNameInterface(type, name); if (subjectAlternativeNames == null) { ! subjectAlternativeNames = new HashSet<List<?>>(); } if (subjectAlternativeGeneralNames == null) { ! subjectAlternativeGeneralNames = new HashSet<GeneralNameInterface>(); } ! List<Object> list = new ArrayList<Object>(2); list.add(Integer.valueOf(type)); list.add(name); subjectAlternativeNames.add(list); subjectAlternativeGeneralNames.add(tempName); } --- 813,828 ---- private void addSubjectAlternativeNameInternal(int type, Object name) throws IOException { // First, ensure that the name parses GeneralNameInterface tempName = makeGeneralNameInterface(type, name); if (subjectAlternativeNames == null) { ! subjectAlternativeNames = new HashSet<>(); } if (subjectAlternativeGeneralNames == null) { ! subjectAlternativeGeneralNames = new HashSet<>(); } ! List<Object> list = new ArrayList<>(2); list.add(Integer.valueOf(type)); list.add(name); subjectAlternativeNames.add(list); subjectAlternativeGeneralNames.add(tempName); }
*** 843,853 **** * not an acceptable value. * @return a Set of {@code GeneralNameInterface}s * @throws IOException if a parsing error occurs */ private static Set<GeneralNameInterface> parseNames(Collection<List<?>> names) throws IOException { ! Set<GeneralNameInterface> genNames = new HashSet<GeneralNameInterface>(); for (List<?> nameList : names) { if (nameList.size() != 2) { throw new IOException("name list size not 2"); } Object o = nameList.get(0); --- 843,853 ---- * not an acceptable value. * @return a Set of {@code GeneralNameInterface}s * @throws IOException if a parsing error occurs */ private static Set<GeneralNameInterface> parseNames(Collection<List<?>> names) throws IOException { ! Set<GeneralNameInterface> genNames = new HashSet<>(); for (List<?> nameList : names) { if (nameList.size() != 2) { throw new IOException("name list size not 2"); } Object o = nameList.get(0);
*** 1094,1107 **** policySet = null; policy = null; } else { // Snapshot set and parse it Set<String> tempSet = Collections.unmodifiableSet ! (new HashSet<String>(certPolicySet)); /* Convert to Vector of ObjectIdentifiers */ Iterator<String> i = tempSet.iterator(); ! Vector<CertificatePolicyId> polIdVector = new Vector<CertificatePolicyId>(); while (i.hasNext()) { Object o = i.next(); if (!(o instanceof String)) { throw new IOException("non String in certPolicySet"); } --- 1094,1107 ---- policySet = null; policy = null; } else { // Snapshot set and parse it Set<String> tempSet = Collections.unmodifiableSet ! (new HashSet<>(certPolicySet)); /* Convert to Vector of ObjectIdentifiers */ Iterator<String> i = tempSet.iterator(); ! Vector<CertificatePolicyId> polIdVector = new Vector<>(); while (i.hasNext()) { Object o = i.next(); if (!(o instanceof String)) { throw new IOException("non String in certPolicySet"); }
*** 1265,1278 **** private void addPathToNameInternal(int type, Object name) throws IOException { // First, ensure that the name parses GeneralNameInterface tempName = makeGeneralNameInterface(type, name); if (pathToGeneralNames == null) { ! pathToNames = new HashSet<List<?>>(); ! pathToGeneralNames = new HashSet<GeneralNameInterface>(); } ! List<Object> list = new ArrayList<Object>(2); list.add(Integer.valueOf(type)); list.add(name); pathToNames.add(list); pathToGeneralNames.add(tempName); } --- 1265,1278 ---- private void addPathToNameInternal(int type, Object name) throws IOException { // First, ensure that the name parses GeneralNameInterface tempName = makeGeneralNameInterface(type, name); if (pathToGeneralNames == null) { ! pathToNames = new HashSet<>(); ! pathToGeneralNames = new HashSet<>(); } ! List<Object> list = new ArrayList<>(2); list.add(Integer.valueOf(type)); list.add(name); pathToNames.add(list); pathToGeneralNames.add(tempName); }
*** 1669,1682 **** * @return a deep copy of the specified {@code Collection} * @throws IOException if a parsing error occurs */ private static Set<List<?>> cloneAndCheckNames(Collection<List<?>> names) throws IOException { // Copy the Lists and Collection ! Set<List<?>> namesCopy = new HashSet<List<?>>(); for (List<?> o : names) { ! namesCopy.add(new ArrayList<Object>(o)); } // Check the contents of the Lists and clone any byte arrays for (List<?> list : namesCopy) { @SuppressWarnings("unchecked") // See javadoc for parameter "names". --- 1669,1682 ---- * @return a deep copy of the specified {@code Collection} * @throws IOException if a parsing error occurs */ private static Set<List<?>> cloneAndCheckNames(Collection<List<?>> names) throws IOException { // Copy the Lists and Collection ! Set<List<?>> namesCopy = new HashSet<>(); for (List<?> o : names) { ! namesCopy.add(new ArrayList<>(o)); } // Check the contents of the Lists and clone any byte arrays for (List<?> list : namesCopy) { @SuppressWarnings("unchecked") // See javadoc for parameter "names".
*** 2395,2405 **** List<PolicyInformation> policies = ext.get(CertificatePoliciesExtension.POLICIES); /* * Convert the Vector of PolicyInformation to a Vector * of CertificatePolicyIds for easier comparison. */ ! List<CertificatePolicyId> policyIDs = new ArrayList<CertificatePolicyId>(policies.size()); for (PolicyInformation info : policies) { policyIDs.add(info.getPolicyIdentifier()); } if (policy != null) { boolean foundOne = false; --- 2395,2405 ---- List<PolicyInformation> policies = ext.get(CertificatePoliciesExtension.POLICIES); /* * Convert the Vector of PolicyInformation to a Vector * of CertificatePolicyIds for easier comparison. */ ! List<CertificatePolicyId> policyIDs = new ArrayList<>(policies.size()); for (PolicyInformation info : policies) { policyIDs.add(info.getPolicyIdentifier()); } if (policy != null) { boolean foundOne = false;
< prev index next >