[jboss-cvs] JBossAS SVN: r60054 - branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Jan 27 17:23:26 EST 2007
Author: alex.loubyansky at jboss.com
Date: 2007-01-27 17:23:26 -0500 (Sat, 27 Jan 2007)
New Revision: 60054
Modified:
branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java
Log:
JBAS-4033
Modified: branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java
===================================================================
--- branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java 2007-01-27 21:52:06 UTC (rev 60053)
+++ branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java 2007-01-27 22:23:26 UTC (rev 60054)
@@ -246,7 +246,13 @@
private int getPartitionIndex(Object key)
{
- return Math.abs(key.hashCode()) % partitions.length;
+ int hash = key.hashCode();
+ // make it positive
+ if(hash < 0)
+ {
+ hash = hash == Integer.MIN_VALUE ? Integer.MAX_VALUE : -hash;
+ }
+ return hash % partitions.length;
}
// Inner
More information about the jboss-cvs-commits
mailing list