You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2011/07/03 13:30:47 UTC

svn commit: r1142417 - /wicket/trunk/wicket-core/src/test/java/org/apache/wicket/protocol/http/StoredResponsesMapTest.java

Author: mgrigorov
Date: Sun Jul  3 11:30:46 2011
New Revision: 1142417

URL: http://svn.apache.org/viewvc?rev=1142417&view=rev
Log:
WICKET-3860 StoredResponsesMapTest Random.nextInt takes only positive integer arguments, not 0


Modified:
    wicket/trunk/wicket-core/src/test/java/org/apache/wicket/protocol/http/StoredResponsesMapTest.java

Modified: wicket/trunk/wicket-core/src/test/java/org/apache/wicket/protocol/http/StoredResponsesMapTest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/test/java/org/apache/wicket/protocol/http/StoredResponsesMapTest.java?rev=1142417&r1=1142416&r2=1142417&view=diff
==============================================================================
--- wicket/trunk/wicket-core/src/test/java/org/apache/wicket/protocol/http/StoredResponsesMapTest.java (original)
+++ wicket/trunk/wicket-core/src/test/java/org/apache/wicket/protocol/http/StoredResponsesMapTest.java Sun Jul  3 11:30:46 2011
@@ -127,7 +127,9 @@ public class StoredResponsesMapTest
 					keys.add(key);
 					map.put(key, new BufferedWebResponse(null));
 
-					String key2 = keys.get(rnd.nextInt(keys.size() - 1));
+					int randomMax = keys.size() - 1;
+					int toRemove = randomMax == 0 ? 0 : rnd.nextInt(randomMax);
+					String key2 = keys.get(toRemove);
 					map.remove(key2);
 				}
 				endLatch.countDown();