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

@ -61,7 +61,7 @@ public class HostnameChecker {
private static final int ALTNAME_DNS = 2;
private static final int ALTNAME_IP = 7;
// the algorithm to follow to perform the check. Currently unused.
// the algorithm to follow to perform the check. Currently, unused.
private final byte checkType;
private HostnameChecker(byte checkType) {
@ -119,12 +119,8 @@ public class HostnameChecker {
* Likewise for IP addresses when it returns false.
*/
private static boolean isIpAddress(String name) {
if (IPAddressUtil.isIPv4LiteralAddress(name) ||
IPAddressUtil.isIPv6LiteralAddress(name)) {
return true;
} else {
return false;
}
return IPAddressUtil.isIPv4LiteralAddress(name) ||
IPAddressUtil.isIPv6LiteralAddress(name);
}
/**
@ -288,7 +284,7 @@ public class HostnameChecker {
// check the validity of the domain name template.
try {
// Replacing wildcard character '*' with 'z' so as to check
// Replacing wildcard character '*' with 'z' to check
// the domain name template validity.
//
// Using the checking implemented in SNIHostName
@ -414,7 +410,7 @@ public class HostnameChecker {
return name.equals(template);
boolean isBeginning = true;
String beforeWildcard = "";
String beforeWildcard;
String afterWildcard = template;
while (wildcardIdx != -1) {