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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to