< prev index next >
src/java.base/share/classes/java/security/cert/X509CRLSelector.java
Print this page
*** 122,133 ****
if ((issuers == null) || issuers.isEmpty()) {
issuerNames = null;
issuerX500Principals = null;
} else {
// clone
! issuerX500Principals = new HashSet<X500Principal>(issuers);
! issuerNames = new HashSet<Object>();
for (X500Principal p : issuerX500Principals) {
issuerNames.add(p.getEncoded());
}
}
}
--- 122,133 ----
if ((issuers == null) || issuers.isEmpty()) {
issuerNames = null;
issuerX500Principals = null;
} else {
// clone
! issuerX500Principals = new HashSet<>(issuers);
! issuerNames = new HashSet<>();
for (X500Principal p : issuerX500Principals) {
issuerNames.add(p.getEncoded());
}
}
}
*** 286,299 ****
* @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>();
}
if (issuerX500Principals == null) {
! issuerX500Principals = new HashSet<X500Principal>();
}
issuerNames.add(name);
issuerX500Principals.add(principal);
}
--- 286,299 ----
* @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<>();
}
if (issuerX500Principals == null) {
! issuerX500Principals = new HashSet<>();
}
issuerNames.add(name);
issuerX500Principals.add(principal);
}
*** 309,319 ****
* @throws IOException if a parsing error occurs
*/
private static HashSet<Object> cloneAndCheckIssuerNames(Collection<?> names)
throws IOException
{
! HashSet<Object> namesCopy = new HashSet<Object>();
Iterator<?> i = names.iterator();
while (i.hasNext()) {
Object nameObject = i.next();
if (!(nameObject instanceof byte []) &&
!(nameObject instanceof String))
--- 309,319 ----
* @throws IOException if a parsing error occurs
*/
private static HashSet<Object> cloneAndCheckIssuerNames(Collection<?> names)
throws IOException
{
! HashSet<Object> namesCopy = new HashSet<>();
Iterator<?> i = names.iterator();
while (i.hasNext()) {
Object nameObject = i.next();
if (!(nameObject instanceof byte []) &&
!(nameObject instanceof String))
*** 361,371 ****
* @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>();
for (Iterator<Object> t = names.iterator(); t.hasNext(); ) {
Object nameObject = t.next();
if (nameObject instanceof String) {
x500Principals.add(new X500Name((String)nameObject).asX500Principal());
} else {
--- 361,371 ----
* @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<>();
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,711 ****
public Object clone() {
try {
X509CRLSelector copy = (X509CRLSelector)super.clone();
if (issuerNames != null) {
copy.issuerNames =
! new HashSet<Object>(issuerNames);
copy.issuerX500Principals =
! new HashSet<X500Principal>(issuerX500Principals);
}
return copy;
} catch (CloneNotSupportedException e) {
/* Cannot happen */
throw new InternalError(e.toString(), e);
--- 699,711 ----
public Object clone() {
try {
X509CRLSelector copy = (X509CRLSelector)super.clone();
if (issuerNames != null) {
copy.issuerNames =
! new HashSet<>(issuerNames);
copy.issuerX500Principals =
! new HashSet<>(issuerX500Principals);
}
return copy;
} catch (CloneNotSupportedException e) {
/* Cannot happen */
throw new InternalError(e.toString(), e);
< prev index next >