]
Tom Ross updated JBMESSAGING-1913:
----------------------------------
JBoss Messaging throws an java.lang.IllegalArgumentException
exception
-----------------------------------------------------------------------
Key: JBMESSAGING-1913
URL:
https://issues.jboss.org/browse/JBMESSAGING-1913
Project: JBoss Messaging
Issue Type: Bug
Components: JMS Client Manager
Environment: JBoss EAP 5.1.2
Reporter: Tom Ross
Assignee: Yong Hao Gao
The code for org.jboss.jms.client.plugin.RoundRobinLoadBalancingPolicy.getNext() method
calls Random.nextInt(int n) with negative argument. This is wrong since the Java JDK 1.6
documentation states that the nextInt(int n) method must be called with a positive number.
This is method implementation as per JDK 1.6 documentation.
public int nextInt(int n) {
if (n <= 0)
throw new IllegalArgumentException("n must be positive");
if ((n & -n) == n) // i.e., n is a power of 2
return (int)((n * (long)next(31)) >> 31);
int bits, val;
do {
bits = next(31);
val = bits % n;
} while (bits - val + (n-1) < 0);
return val;
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: