Browse Source

Make sure the id is between 1 and 10000

Brian Hauer 11 years ago
parent
commit
40489856a0

+ 1 - 2
dropwizard/src/main/java/com/example/helloworld/resources/WorldResource.java

@@ -1,4 +1,3 @@
-
 package com.example.helloworld.resources;
 package com.example.helloworld.resources;
 
 
 import java.util.Random;
 import java.util.Random;
@@ -35,7 +34,7 @@ public class WorldResource
 
 
     for (int i = 0; i < totalQueries; i++)
     for (int i = 0; i < totalQueries; i++)
     {
     {
-      worlds[i] = this.worldDAO.findById((long)random.nextInt(10000)).orNull();
+      worlds[i] = this.worldDAO.findById((long)(random.nextInt(10000) + 1)).orNull();
     }
     }
     return worlds;
     return worlds;
   }
   }