Handle a negative value returned by Math.abs() #25034

This commit is contained in:
promanski 2018-05-01 16:43:56 +02:00 committed by Piotr Romański
parent 1ca612985e
commit 05282b59c9
9 changed files with 10 additions and 10 deletions

View file

@ -158,7 +158,7 @@ public class HubDocTest extends AbstractJavaTest {
RunnableGraph<Source<String, NotUsed>> runnableGraph =
producer.toMat(PartitionHub.of(
String.class,
(size, elem) -> Math.abs(elem.hashCode()) % size,
(size, elem) -> Math.abs(elem.hashCode() % size),
2, 256), Keep.right());
// By running/materializing the producer, we get back a Source, which