[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: .NET Client Conversion

clebert.suconic@jboss.com do-not-reply at jboss.com
Mon Feb 2 20:54:02 EST 2009


There is an issue on the SimpleString hashCode calculation.


This loop:

   public int hashCode()
  |    {
  |       if (hash == 0)
  |       {
  |          for (int i = 0; i < data.length; i++)
  |          {
  |             hash = 31 * hash + data;
  |          }
  |       }
  | 
  |       return hash;
  |    }
  | 
  | 


Is eventually overflowing MaxInt, and that's considered an Exception in C#.

I'm looking to how hashes are calculated in mono, and I will try using the same function.




View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206416#4206416

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206416



More information about the jboss-dev-forums mailing list