hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Gl├╝ck <ortwin.glu...@nose.ch>
Subject NameValuePair.equals
Date Mon, 08 Sep 2003 07:03:00 GMT
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


Mime
View raw message