commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From otisg <ot...@ureach.com>
Subject Re: HttpClient NullPointerException in equals(Object o) of org.apache.commons.httpclient.NameValuePair
Date Sat, 29 Jun 2002 21:51:25 GMT
I'm not a commiter for HttpClient, but I can
tell you that your contribution will make it
in the CVS faster if you contribute it as a
context diff (cvs diff -c or just diff -c
<old file> <file with your fix>), and just
attach that to your email.

Otis




---- On Sat, 29 Jun 2002, Rand McNeely
(rand_mcneely@yahoo.com) wrote:

> This is my first contribution to a Jakarta
project, if I am in poor
> form, let me know.
> 
> Before calling object.getClass(), check to
see if passed object is null.
> 
>     /**
>      * Test if the given <i>object</i> is
equal to me.
>      * In this implementation, an
<i>object</i> is
>      * equal to me iff it has the same runtime
>      * type and the <i>name</i> and
<i>value</i> attributes
>      * are both <tt>equal</tt> (or
<tt>==</tt>).
>      *
>      * @param object the {@link Object} to
compare to
>      */
>     public boolean equals(Object object) {
>         if (this == object) {
>             return true;
>         } else if (null == object) {
>             return false;
>         } else if
(this.getClass().equals(object.getClass())) {
>             NameValuePair pair =
(NameValuePair) object;
>             return ((null == name ? null
== pair.name :
> name.equals(pair.name))
>                    && (null == value ?
null == pair.value :
> value.equals(pair.value)));
>         } else {
>             return false;
>         }
>     }
> 
> Thanks,
> Rand
> 
> 
> --
> To unsubscribe, e-mail:  
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>
> 
> 
> 


________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

--
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