NIFI-9727 - IndexOutOfBoundsException in CorrelationAttributePartitioner

This closes #5804

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Paul Grey 2022-02-25 10:06:59 -05:00 committed by exceptionfactory
parent 49d1c747ca
commit e74991e705
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA
1 changed files with 1 additions and 5 deletions

View File

@ -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);
}
}