You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ro...@apache.org on 2007/02/02 18:29:20 UTC

svn commit: r502662 - in /jakarta/httpcomponents/httpcore/trunk/module-main/src: main/java/org/apache/http/ main/java/org/apache/http/message/ test/java/org/apache/http/message/

Author: rolandw
Date: Fri Feb  2 09:29:19 2007
New Revision: 502662

URL: http://svn.apache.org/viewvc?view=rev&rev=502662
Log:
HttpVersion cleanup

Modified:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpStatus.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpVersion.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpVersion.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestHttpVersion.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpStatus.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpStatus.java?view=diff&rev=502662&r1=502661&r2=502662
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpStatus.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpStatus.java Fri Feb  2 09:29:19 2007
@@ -33,7 +33,7 @@
 
 /**
  * Constants enumerating the HTTP status codes.
- * All status codes defined in RFC1945 (HTTP/1.0, RFC2616 (HTTP/1.1), and
+ * All status codes defined in RFC1945 (HTTP/1.0), RFC2616 (HTTP/1.1), and
  * RFC2518 (WebDAV) are supported.
  * 
  * @see StatusLine

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpVersion.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpVersion.java?view=diff&rev=502662&r1=502661&r2=502662
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpVersion.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpVersion.java Fri Feb  2 09:29:19 2007
@@ -31,47 +31,17 @@
 
 package org.apache.http;
 
+import java.io.Serializable;
 import org.apache.http.util.CharArrayBuffer;
 
 /**
- *  <p>HTTP version, as specified in RFC 2616.</p>
- *  <p>
- *  HTTP uses a "&lt;major&gt;.&lt;minor&gt;" numbering scheme to indicate
- *  versions of the protocol. The protocol versioning policy is intended to
- *  allow the sender to indicate the format of a message and its capacity for
- *  understanding further HTTP communication, rather than the features
- *  obtained via that communication. No change is made to the version
- *  number for the addition of message components which do not affect
- *  communication behavior or which only add to extensible field values.
- *  The &lt;minor&gt; number is incremented when the changes made to the
- *  protocol add features which do not change the general message parsing
- *  algorithm, but which may add to the message semantics and imply
- *  additional capabilities of the sender. The &lt;major&gt; number is
- *  incremented when the format of a message within the protocol is
- *  changed. See RFC 2145 [36] for a fuller explanation.
- *  </p>
- *  <p>
- *  The version of an HTTP message is indicated by an HTTP-Version field
- *  in the first line of the message.
- *  </p>
- *  <pre>
- *     HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
- *  </pre>
- *  <p>
- *   Note that the major and minor numbers MUST be treated as separate
- *   integers and that each MAY be incremented higher than a single digit.
- *   Thus, HTTP/2.4 is a lower version than HTTP/2.13, which in turn is
- *   lower than HTTP/12.3. Leading zeros MUST be ignored by recipients and
- *   MUST NOT be sent.
- *  </p>
+ * Represents an HTTP version, as specified in RFC 2616.
  * 
  * @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
  * 
  * @version $Revision$ $Date$
- *
- * @since 3.0
  */
-public class HttpVersion implements Comparable {
+public final class HttpVersion implements Comparable, Serializable {
 
     /** Major version number of the HTTP protocol */
     private int major = 0;

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpVersion.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpVersion.java?view=diff&rev=502662&r1=502661&r2=502662
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpVersion.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpVersion.java Fri Feb  2 09:29:19 2007
@@ -36,20 +36,8 @@
 import org.apache.http.protocol.HTTP;
 import org.apache.http.util.CharArrayBuffer;
 
-public class BasicHttpVersion extends HttpVersion {
+public class BasicHttpVersion {
 
-    /**
-     * Create an HTTP protocol version designator.
-     *
-     * @param major   the major version number of the HTTP protocol
-     * @param minor   the minor version number of the HTTP protocol
-     * 
-     * @throws IllegalArgumentException if either major or minor version number is negative
-     */
-    public BasicHttpVersion(int major, int minor) {
-        super(major, minor);
-    }
-    
     /**
      * Parses the textual representation of the given HTTP protocol version.
      * 

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestHttpVersion.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestHttpVersion.java?view=diff&rev=502662&r1=502661&r2=502662
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestHttpVersion.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestHttpVersion.java Fri Feb  2 09:29:19 2007
@@ -62,7 +62,7 @@
     // ------------------------------------------------------------------ Tests
     
     public void testHttpVersionParsing() throws Exception {
-        new BasicHttpVersion(1, 1);
+        new HttpVersion(1, 1);
         String s = "HTTP/1.1";
         HttpVersion version = BasicHttpVersion.parse(s);
         assertEquals("HTTP major version number", 1, version.getMajor());