You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2017/03/28 15:54:38 UTC
svn commit: r1789170 -
/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/DefaultHostnameVerifier.java
Author: ggregory
Date: Tue Mar 28 15:54:38 2017
New Revision: 1789170
URL: http://svn.apache.org/viewvc?rev=1789170&view=rev
Log:
Statement unnecessarily nested within else clause.
Modified:
httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/DefaultHostnameVerifier.java
Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/DefaultHostnameVerifier.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/DefaultHostnameVerifier.java?rev=1789170&r1=1789169&r2=1789170&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/DefaultHostnameVerifier.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/DefaultHostnameVerifier.java Tue Mar 28 15:54:38 2017
@@ -282,14 +282,13 @@ public final class DefaultHostnameVerifi
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;
}