Merge pull request #25035 from piotrromanski/wip-fix-math-abs-usage

Handle a negative value returned by Math.abs()
This commit is contained in:
Patrik Nordwall 2018-08-27 16:29:32 +02:00 committed by GitHub
commit d5b2aea176
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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