commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12727] New: - [PATCH] fix NPE in RequestImpl.setVersion
Date Tue, 17 Sep 2002 09:58:55 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12727>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12727

[PATCH] fix NPE in RequestImpl.setVersion

           Summary: [PATCH] fix NPE in RequestImpl.setVersion
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Latka
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: janekdb@yahoo.co.uk


The CVS version of latka using the CVS version of httpclient was throwing this
exception

Exception in thread "main" java.lang.NullPointerException
        at org.apache.commons.latka.http.RequestImpl.setVersion(Unknown Source)
        at org.apache.commons.latka.http.SessionImpl.createRequest(Unknown Source)
        at org.apache.commons.latka.xml.RequestHandler.buildRequest(Unknown Source)
        at org.apache.commons.latka.xml.RequestHandler.startElement(Unknown Source)
        at
org.apache.commons.latka.util.xml.BasicDelegateHandler.delegate(Unknown Source)

and this patchs setVersion to use HTTP/1.1 when the version string is null.

Index: RequestImpl.java
===================================================================
RCS file:
/home/cvspublic/jakarta-commons/latka/src/java/org/apache/commons/latka/http/RequestImpl.java,v
retrieving revision 1.29
diff -u -r1.29 RequestImpl.java
--- RequestImpl.java	4 Sep 2002 02:59:26 -0000	1.29
+++ RequestImpl.java	17 Sep 2002 09:49:56 -0000
@@ -511,8 +511,10 @@
      * @param version  HTTP version
      */
     public void setVersion(String version) {
-        if (version.equals(HTTP_10)) {
+        if (HTTP_10.equals(version)) {
             ((HttpMethodBase) _httpMethod).setHttp11(false);
+        } else {
+            ((HttpMethodBase) _httpMethod).setHttp11(true);
         }
     }
 }

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message