[erlang-patches] [jinterface] added OtpMbox.hash()

Raimo Niskanen raimo+erlang-patches@REDACTED
Tue Sep 21 11:51:20 CEST 2010


On Mon, Sep 20, 2010 at 07:11:51PM +0200, Vlad Dumitrescu wrote:
> On Mon, Sep 20, 2010 at 17:10, Raimo Niskanen
> <raimo+erlang-patches@REDACTED> wrote:
> > Excuse me for a maybe stupid question...
> >
> > Why is it necessary?
> >
> > Calling self.hashCode() from a class inheriting from Object
> > should be done through inheritance without the patch.
> >
> > Is there some tool complaining if both are not overridden
> > even if the result is correct (or is it not?), or have
> > have the rules changed since the old days, or am
> > I missing something?...
> 
> Not a stupid question, but almost every static analysis tool complains
> about this.
> 
> In any case, the patch calls self.hash(), not super.hash(). Whatever
> is compared in equals() should be included when computing the hash.

Thank you, now I see the light! I have been programming Erlang too
long and mistook 'self' with 'this'...

So the current inherited hashCode() function is incorrect
in calling super.hashCode(). We will take the patch as it is,
a test case seems to be not worth the trouble.

> 
> best regards,
> Vlad
> 
> ________________________________________________________________
> erlang-patches (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB


More information about the erlang-patches mailing list