hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: [PATCH] Fix for NullPointerException in HttpMethodBase
Date Wed, 08 Jan 2003 02:46:27 GMT
Wow.  I just realized that I submitted almost the exact same patch,  
except a few days late:)  Boy do I feel stupid.

Mike

On Sunday, December 29, 2002, at 06:15 PM, Maarten Coene wrote:

> Hi,
>
> I get a NullPointerException if I construct a HttpMethod with an query  
> uri.
> Here is a patch to fix this.
>
> I've also included a unit test for this bug (see attachment).
>
> regards,
> Maarten Coene
>
>
> cvs diff -u HttpMethodBase.java
> Index: HttpMethodBase.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/ 
> commons/httpc
> lient/HttpMethodBase.java,v
> retrieving revision 1.93
> diff -u -r1.93 HttpMethodBase.java
> --- HttpMethodBase.java 20 Dec 2002 09:22:07 -0000 1.93
> +++ HttpMethodBase.java 29 Dec 2002 23:06:12 -0000
> @@ -302,7 +302,7 @@
>              if (pa < 0) { //its just a path
>                  setPath(uri);
>              } else { //its a path with a query
> -                setPath(path.substring(0, pa));
> +                setPath(uri.substring(0, pa));
>                  setQueryString(uri.substring(pa+1, uri.length()));
>              }
>          }
>
>
> cvs diff -u TestNoHost.java
> Index: TestNoHost.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-commons/httpclient/src/test/org/apache/ 
> commons/httpc
> lient/TestNoHost.java,v
> retrieving revision 1.16
> diff -u -r1.16 TestNoHost.java
> --- TestNoHost.java 3 Dec 2002 15:28:18 -0000 1.16
> +++ TestNoHost.java 29 Dec 2002 23:13:37 -0000
> @@ -101,6 +101,7 @@
>          suite.addTest(TestStreams.suite());
>          suite.addTest(TestStatusLine.suite());
>          suite.addTest(TestPartsNoHost.suite());
> +        suite.addTest(TestHttpMethodBase.suite());
>          return suite;
>      }
>
>
> <TestHttpMethodBase.java>--
> To unsubscribe, e-mail:    
> <mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:  
> <mailto:commons-httpclient-dev-help@jakarta.apache.org>


Mime
View raw message