mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8291509: Minor cleanup could be done in sun.security
Reviewed-by: weijun
This commit is contained in:
parent
6beeb8471c
commit
4cec141a90
298 changed files with 2650 additions and 3262 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue