Statement unnecessarily nested within else clause.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1789170 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2017-03-28 15:54:38 +00:00
parent b1f8cd58f6
commit 192acfde4d

View File

@ -282,14 +282,13 @@ static String extractCN(final String subjectPrincipal) throws SSLException {
static HostNameType determineHostFormat(final String host) {
if (InetAddressUtils.isIPv4Address(host)) {
return HostNameType.IPv4;
} else {
String s = host;
if (s.startsWith("[") && s.endsWith("]")) {
s = host.substring(1, host.length() - 1);
}
if (InetAddressUtils.isIPv6Address(s)) {
return HostNameType.IPv6;
}
}
String s = host;
if (s.startsWith("[") && s.endsWith("]")) {
s = host.substring(1, host.length() - 1);
}
if (InetAddressUtils.isIPv6Address(s)) {
return HostNameType.IPv6;
}
return HostNameType.DNS;
}