hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1558049 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultSchemePortResolver.java
Date Tue, 14 Jan 2014 14:38:23 GMT
Author: ggregory
Date: Tue Jan 14 14:38:23 2014
New Revision: 1558049

URL: http://svn.apache.org/r1558049
Log:
Simplify: no need for extra branch.

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultSchemePortResolver.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultSchemePortResolver.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultSchemePortResolver.java?rev=1558049&r1=1558048&r2=1558049&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultSchemePortResolver.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultSchemePortResolver.java
Tue Jan 14 14:38:23 2014
@@ -47,15 +47,14 @@ public class DefaultSchemePortResolver i
         final int port = host.getPort();
         if (port > 0) {
             return port;
+        }
+        final String name = host.getSchemeName();
+        if (name.equalsIgnoreCase("http")) {
+            return 80;
+        } else if (name.equalsIgnoreCase("https")) {
+            return 443;
         } else {
-            final String name = host.getSchemeName();
-            if (name.equalsIgnoreCase("http")) {
-                return 80;
-            } else if (name.equalsIgnoreCase("https")) {
-                return 443;
-            } else {
-                throw new UnsupportedSchemeException(name + " protocol is not supported");
-            }
+            throw new UnsupportedSchemeException(name + " protocol is not supported");
         }
     }
 



Mime
View raw message