You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2002/09/17 11:58:55 UTC
DO NOT REPLY [Bug 12727] New: -
[PATCH] fix NPE in RequestImpl.setVersion
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>