Skip to content

Commit 4048985

Browse files
author
Brian Hauer
committed
Make sure the id is between 1 and 10000
1 parent 8fa2dd3 commit 4048985

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

dropwizard/src/main/java/com/example/helloworld/resources/WorldResource.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
package com.example.helloworld.resources;
32

43
import java.util.Random;
@@ -35,7 +34,7 @@ public World[] dbTest(@QueryParam("queries") Optional<Integer> queries)
3534

3635
for (int i = 0; i < totalQueries; i++)
3736
{
38-
worlds[i] = this.worldDAO.findById((long)random.nextInt(10000)).orNull();
37+
worlds[i] = this.worldDAO.findById((long)(random.nextInt(10000) + 1)).orNull();
3938
}
4039
return worlds;
4140
}

0 commit comments

Comments
 (0)