mirror of https://github.com/apache/nifi.git
NIFI-9727 - IndexOutOfBoundsException in CorrelationAttributePartitioner
This closes #5804 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
49d1c747ca
commit
e74991e705
|
@ -70,10 +70,6 @@ public class CorrelationAttributePartitioner implements FlowFilePartitioner {
|
|||
|
||||
private int findIndex(final long hash, final int partitions) {
|
||||
final Random random = new Random(hash);
|
||||
int index = random.nextInt();
|
||||
while (index < 0 && index >= partitions) {
|
||||
index = random.nextInt();
|
||||
}
|
||||
return index;
|
||||
return random.nextInt(partitions);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue