You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2017/05/09 19:58:30 UTC

[38/50] [abbrv] httpcomponents-core git commit: HttpHost to use URIScheme

HttpHost to use URIScheme

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk@1792797 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/9d6ec2b5
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/9d6ec2b5
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/9d6ec2b5

Branch: refs/heads/trunk
Commit: 9d6ec2b541d21752d96035df51daa556091823c2
Parents: e92e3ec
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Wed Apr 26 19:21:54 2017 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Wed Apr 26 19:21:54 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/hc/core5/http/HttpHost.java     | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/9d6ec2b5/httpcore5/src/main/java/org/apache/hc/core5/http/HttpHost.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/HttpHost.java b/httpcore5/src/main/java/org/apache/hc/core5/http/HttpHost.java
index 405933f..f101c1c 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/HttpHost.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/HttpHost.java
@@ -53,7 +53,7 @@ public final class HttpHost implements NamedEndpoint, Serializable {
     private static final long serialVersionUID = -7529410654042457626L;
 
     /** The default scheme is "http". */
-    public static final String DEFAULT_SCHEME_NAME = "http";
+    public static final URIScheme DEFAULT_SCHEME = URIScheme.HTTP;
 
     /** The host to use. */
     private final String hostname;
@@ -91,7 +91,7 @@ public final class HttpHost implements NamedEndpoint, Serializable {
      *                  {@code -1} indicates the scheme default port.
      * @param scheme    the name of the scheme.
      *                  {@code null} indicates the
-     *                  {@link #DEFAULT_SCHEME_NAME default scheme}
+     *                  {@link #DEFAULT_SCHEME default scheme}
      *
      * @throws IllegalArgumentException
      *             If the port parameter is outside the specified range of valid port values, which is between 0 and
@@ -104,7 +104,7 @@ public final class HttpHost implements NamedEndpoint, Serializable {
         if (scheme != null) {
             this.schemeName = scheme.toLowerCase(Locale.ROOT);
         } else {
-            this.schemeName = DEFAULT_SCHEME_NAME;
+            this.schemeName = DEFAULT_SCHEME.id;
         }
         this.port = Ports.check(port);
         this.address = null;
@@ -131,7 +131,7 @@ public final class HttpHost implements NamedEndpoint, Serializable {
      * @param hostname  the hostname (IP or DNS name)
      * @param scheme    the name of the scheme.
      *                  {@code null} indicates the
-     *                  {@link #DEFAULT_SCHEME_NAME default scheme}
+     *                  {@link #DEFAULT_SCHEME default scheme}
      *
      * @throws IllegalArgumentException
      *             If the port parameter is outside the specified range of valid port values, which is between 0 and
@@ -174,7 +174,7 @@ public final class HttpHost implements NamedEndpoint, Serializable {
         return new HttpHost(
                 text.toLowerCase(Locale.ROOT),
                 port,
-                scheme != null ? scheme.toLowerCase(Locale.ROOT) : DEFAULT_SCHEME_NAME, true);
+                scheme != null ? scheme.toLowerCase(Locale.ROOT) : DEFAULT_SCHEME.id, true);
     }
 
     /**
@@ -198,7 +198,7 @@ public final class HttpHost implements NamedEndpoint, Serializable {
      *                  {@code -1} indicates the scheme default port.
      * @param scheme    the name of the scheme.
      *                  {@code null} indicates the
-     *                  {@link #DEFAULT_SCHEME_NAME default scheme}
+     *                  {@link #DEFAULT_SCHEME default scheme}
      *
      * @throws IllegalArgumentException
      *             If the port parameter is outside the specified range of valid port values, which is between 0 and
@@ -219,7 +219,7 @@ public final class HttpHost implements NamedEndpoint, Serializable {
      *                  {@code -1} indicates the scheme default port.
      * @param scheme    the name of the scheme.
      *                  {@code null} indicates the
-     *                  {@link #DEFAULT_SCHEME_NAME default scheme}
+     *                  {@link #DEFAULT_SCHEME default scheme}
      *
      * @throws IllegalArgumentException
      *             If the port parameter is outside the specified range of valid port values, which is between 0 and
@@ -235,7 +235,7 @@ public final class HttpHost implements NamedEndpoint, Serializable {
         if (scheme != null) {
             this.schemeName = scheme.toLowerCase(Locale.ROOT);
         } else {
-            this.schemeName = DEFAULT_SCHEME_NAME;
+            this.schemeName = DEFAULT_SCHEME.id;
         }
         this.port = Ports.check(port);
     }