[erlang-bugs] jinterface 1.4.2 : OtpErlangRef missing hashCode method

Raimo Niskanen raimo+erlang-bugs@REDACTED
Wed Mar 18 16:11:42 CET 2009


On Mon, Nov 24, 2008 at 07:07:33AM +0100, Paul Guyot wrote:
> Hello,
> 
> OtpErlangRef class (and probably others) is missing the hashCode  
> method, while it overrides the equal method. As a result, refs cannot  
> be put in a hash structure (e.g. HashMap).
> 
> final HashMap<OtpErlangRef, Object> myMap = new HashMap<OtpErlangRef,  
> Object>();
> myMap.put(ref1, obj1);
> assertNotNull(myMap.get(ref1));	// <-- fails
> 
> The attached patch adds an implementation of hashCode for  
> OtpErlangRef, which is compatible with the equal method.
> 
> Regards,
> 
> Paul

Thank you for pointing this out. We will try to fix it for R13B.


> 

> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-bugs

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list