8291509: Minor cleanup could be done in sun.security

Reviewed-by: weijun
This commit is contained in:
Mark Powers 2022-09-15 19:59:53 +00:00 committed by Weijun Wang
parent 6beeb8471c
commit 4cec141a90
298 changed files with 2650 additions and 3262 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -72,7 +72,7 @@ public final class SunCertPathBuilder extends CertPathBuilderSpi {
* private objects shared by methods
*/
private BuilderParams buildParams;
private CertificateFactory cf;
private final CertificateFactory cf;
private boolean pathCompleted = false;
private PolicyNode policyTreeResult;
private TrustAnchor trustAnchor;
@ -218,7 +218,7 @@ public final class SunCertPathBuilder extends CertPathBuilderSpi {
/* Initialize adjacency list */
adjacencyList.clear();
adjacencyList.add(new LinkedList<Vertex>());
adjacencyList.add(new LinkedList<>());
currentState.untrustedChecker = new UntrustedChecker();
@ -269,16 +269,16 @@ public final class SunCertPathBuilder extends CertPathBuilderSpi {
/*
* For each cert in the collection, verify anything
* that hasn't been checked yet (signature, revocation, etc)
* that hasn't been checked yet (signature, revocation, etc.)
* and check for loops. Call depthFirstSearchForward()
* recursively for each good cert.
*/
vertices:
for (Vertex vertex : vertices) {
/**
/*
* Restore state to currentState each time through the loop.
* This is important because some of the user-defined
* This is important because some user-defined
* checkers modify the state, which MUST be restored if
* the cert eventually fails to lead to the target and
* the next matching cert is tried.
@ -405,7 +405,7 @@ public final class SunCertPathBuilder extends CertPathBuilderSpi {
Set<String> unresCritExts =
currCert.getCriticalExtensionOIDs();
if (unresCritExts == null) {
unresCritExts = Collections.<String>emptySet();
unresCritExts = Collections.emptySet();
}
for (PKIXCertPathChecker currChecker : checkers) {
@ -521,7 +521,7 @@ public final class SunCertPathBuilder extends CertPathBuilderSpi {
* Append an entry for cert in adjacency list and
* set index for current vertex.
*/
adjList.add(new LinkedList<Vertex>());
adjList.add(new LinkedList<>());
vertex.setIndex(adjList.size() - 1);
/* recursively search for matching certs at next dN */