hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r692584 - /httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java
Date Fri, 05 Sep 2008 23:53:10 GMT
Author: olegk
Date: Fri Sep  5 16:53:10 2008
New Revision: 692584

URL: http://svn.apache.org/viewvc?rev=692584&view=rev
Log:
Reverted API incompatible changes (removed #setProtocolversion() and #setUri() methods)

Modified:
    httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java

Modified: httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java?rev=692584&r1=692583&r2=692584&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java
(original)
+++ httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java
Fri Sep  5 16:53:10 2008
@@ -47,12 +47,12 @@
  */
 public class BasicHttpRequest extends AbstractHttpMessage implements HttpRequest {
     
-    private RequestLine requestline;
-    private String method;
-    private String uri;
-    private ProtocolVersion ver;
+    private final String method;
+    private final String uri;
         
-    public BasicHttpRequest(final String method, final String uri, final ProtocolVersion
ver) {
+    private RequestLine requestline;
+
+    public BasicHttpRequest(final String method, final String uri) {
         super();
         if (method == null) {
             throw new IllegalArgumentException("Method name may not be null");
@@ -62,10 +62,13 @@
         }
         this.method = method;
         this.uri = uri;
-        this.ver = ver;
         this.requestline = null;
     }
 
+    public BasicHttpRequest(final String method, final String uri, final ProtocolVersion
ver) {
+        this(new BasicRequestLine(method, uri, ver));
+    }
+
     public BasicHttpRequest(final RequestLine requestline) {
         super();
         if (requestline == null) {
@@ -74,39 +77,18 @@
         this.requestline = requestline;
         this.method = requestline.getMethod();
         this.uri = requestline.getUri();
-        this.ver = requestline.getProtocolVersion();
-    }
-
-    public BasicHttpRequest(final String method, final String uri) {
-        this(method, uri, null);
     }
 
     public ProtocolVersion getProtocolVersion() {
-        if (this.ver == null) {
-            this.ver = HttpProtocolParams.getVersion(getParams());
-        }
-        return this.ver;
+        return getRequestLine().getProtocolVersion();
     }
     
     public RequestLine getRequestLine() {
         if (this.requestline == null) {
-            this.requestline = new BasicRequestLine(this.method, this.uri, 
-                    getProtocolVersion());
+            ProtocolVersion ver = HttpProtocolParams.getVersion(getParams());
+            this.requestline = new BasicRequestLine(this.method, this.uri, ver);
         }
         return this.requestline;
     }
     
-    public void setUri(final String uri) {
-        if (uri == null) {
-            throw new IllegalArgumentException("Request URI may not be null");
-        }
-        this.uri = uri;
-        this.requestline = null;
-    }
-    
-    public void setProtocolVersion(final ProtocolVersion ver) {
-        this.ver = ver;
-        this.requestline = null;
-    }
-    
 }



Mime
View raw message