From 40489856a0480c85227993d91de7d66e9224f8b4 Mon Sep 17 00:00:00 2001 From: Brian Hauer Date: Tue, 10 Dec 2013 16:43:57 -0800 Subject: [PATCH] Make sure the id is between 1 and 10000 --- .../java/com/example/helloworld/resources/WorldResource.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dropwizard/src/main/java/com/example/helloworld/resources/WorldResource.java b/dropwizard/src/main/java/com/example/helloworld/resources/WorldResource.java index 927ce8e751f..47720e46c73 100644 --- a/dropwizard/src/main/java/com/example/helloworld/resources/WorldResource.java +++ b/dropwizard/src/main/java/com/example/helloworld/resources/WorldResource.java @@ -1,4 +1,3 @@ - package com.example.helloworld.resources; import java.util.Random; @@ -35,7 +34,7 @@ public World[] dbTest(@QueryParam("queries") Optional queries) 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; }