[jboss-cvs] JBossAS SVN: r60053 - trunk/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 16:52:06 EST 2007
Author: alex.loubyansky at jboss.com
Date: 2007-01-27 16:52:06 -0500 (Sat, 27 Jan 2007)
New Revision: 60053
Modified:
trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java
Log:
JBAS-4033
Modified: trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java 2007-01-27 19:41:23 UTC (rev 60052)
+++ trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java 2007-01-27 21:52:06 UTC (rev 60053)
@@ -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