From cf00306ce243a844cc2fb7372476a252d9c2d870 Mon Sep 17 00:00:00 2001 From: Paul Horn Date: Mon, 18 Sep 2023 12:18:26 +0200 Subject: [PATCH] Generate a random value of the correct type --- .../main/java/org/neo4j/gds/collections/TestGeneratorUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collections-generator/src/main/java/org/neo4j/gds/collections/TestGeneratorUtils.java b/collections-generator/src/main/java/org/neo4j/gds/collections/TestGeneratorUtils.java index f9495831c6..73e267ebf6 100644 --- a/collections-generator/src/main/java/org/neo4j/gds/collections/TestGeneratorUtils.java +++ b/collections-generator/src/main/java/org/neo4j/gds/collections/TestGeneratorUtils.java @@ -116,7 +116,7 @@ public static String randomValue(TypeName valueType) { } else if (valueType == TypeName.FLOAT) { return "random.nextFloat()"; } else if (valueType == TypeName.DOUBLE) { - return "random.nextFloat()"; + return "random.nextDouble()"; } else if (valueType.equals(ArrayTypeName.of(TypeName.BYTE))) { return "new byte[] { " + randomValue(TypeName.BYTE) + " }"; } else if (valueType.equals(ArrayTypeName.of(TypeName.SHORT))) {