hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: NameValuePair.equals
Date Mon, 08 Sep 2003 07:53:17 GMT
This bit defintely needs to be rewritten. Odi, can you take care of it?

Oleg

-----Original Message-----
From: Ortwin Gl├╝ck [mailto:ortwin.glueck@nose.ch]
Sent: Monday, September 08, 2003 09:03
To: Commons HttpClient Project
Subject: NameValuePair.equals


I just came over the code:

     public boolean equals(Object object) {
         if (this == object) {
             return true;
         } 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;
         }
     }


I think the class check should be changed to using the instanceof 
operator. Otherwise subclassing or different classloaders cause problems 
here.


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


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


Mime
View raw message