hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: svn commit: r1044411
Date Fri, 10 Dec 2010 18:20:21 GMT
On Fri, 2010-12-10 at 17:15 +0000, sebb wrote:
> > +    public final boolean equals(Object obj) {
> > +        if (obj == null) return false;
> 
> That null check not necessary, because null fails the instanceof check.
> 

I think it saves one comparison operation. Feel free to remove it, but
ideally all other classes (and they are really a few) should be changed
as well

> > +        if (this == obj) return true;
> > +        if (obj instanceof HttpRoute) {
> > +            HttpRoute that = (HttpRoute) obj;
> > +            return LangUtils.equals(this.targetHost, that.targetHost) &&
> > +                LangUtils.equals(this.localAddress, that.localAddress) &&
> 
> That's a lot neater than the null checks.
> 

That is precisely the intent of LangUtils ;-)

cheers

Oleg


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


Mime
View raw message