ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/Collections/CheckedListBash.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/Collections/CheckedListBash.java (file contents):
Revision 1.7 by jsr166, Sun Oct 11 00:54:27 2015 UTC vs.
Revision 1.8 by jsr166, Sat Oct 21 00:59:54 2017 UTC

# Line 209 | Line 209 | public class CheckedListBash {
209      }
210  
211      static void AddRandoms(List s, int n) {
212 <        for (int i=0; i<n; i++) {
213 <            int r = rnd.nextInt() % n;
214 <            Integer e = new Integer(r < 0 ? -r : r);
212 >        for (int i = 0; i < n; i++) {
213 >            Integer e = rnd.nextInt(n);
214  
215              int preSize = s.size();
216              if (!s.add(e))
217                  fail("Add failed.");
218              int postSize = s.size();
219 <            if (postSize-preSize != 1)
219 >            if (postSize - preSize != 1)
220                  fail("Add didn't increase size by 1.");
221          }
222      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines