Ethan Li created STORM-2950:
-------------------------------
Summary: ArrayIndexOutOfBoundsException in
TupleUtils.chooseTaskIndex function
Key: STORM-2950
URL: https://issues.apache.org/jira/browse/STORM-2950
Project: Apache Storm
Issue Type: Bug
Reporter: Ethan Li
Assignee: Ethan Li
TupleUtils.chooseTaskIndex:
{code:java}
public static <T> int chooseTaskIndex(List<T> keys, int numTasks) {
return Math.abs(listHashCode(keys)) % numTasks;
}
{code}
listHashCode(keys) might return Integer.MIN_VALUE (-2147483648).
Math.abs(-2147483648) equals to -2147483648.
In this case, chooseTaskIndex might return negative numbers and it will cause
ArrayIndexOutOfBoundsException
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)