ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ConcurrentHashMapTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ConcurrentHashMapTest.java (file contents):
Revision 1.56 by jsr166, Wed Aug 23 05:33:00 2017 UTC vs.
Revision 1.57 by jsr166, Sun Jan 7 22:59:18 2018 UTC

# Line 128 | Line 128 | public class ConcurrentHashMapTest exten
128       */
129      public void testComparableFamily() {
130          int size = 500;         // makes measured test run time -> 60ms
131 <        ConcurrentHashMap<BI, Boolean> m =
132 <            new ConcurrentHashMap<BI, Boolean>();
131 >        ConcurrentHashMap<BI, Boolean> m = new ConcurrentHashMap<>();
132          for (int i = 0; i < size; i++) {
133              assertNull(m.put(new CI(i), true));
134          }
# Line 145 | Line 144 | public class ConcurrentHashMapTest exten
144       */
145      public void testGenericComparable() {
146          int size = 120;         // makes measured test run time -> 60ms
147 <        ConcurrentHashMap<Object, Boolean> m =
149 <            new ConcurrentHashMap<Object, Boolean>();
147 >        ConcurrentHashMap<Object, Boolean> m = new ConcurrentHashMap<>();
148          for (int i = 0; i < size; i++) {
149              BI bi = new BI(i);
150              BS bs = new BS(String.valueOf(i));
151 <            LexicographicList<BI> bis = new LexicographicList<BI>(bi);
152 <            LexicographicList<BS> bss = new LexicographicList<BS>(bs);
151 >            LexicographicList<BI> bis = new LexicographicList<>(bi);
152 >            LexicographicList<BS> bss = new LexicographicList<>(bs);
153              assertNull(m.putIfAbsent(bis, true));
154              assertTrue(m.containsKey(bis));
155              if (m.putIfAbsent(bss, true) == null)
# Line 170 | Line 168 | public class ConcurrentHashMapTest exten
168       */
169      public void testGenericComparable2() {
170          int size = 500;         // makes measured test run time -> 60ms
171 <        ConcurrentHashMap<Object, Boolean> m =
174 <            new ConcurrentHashMap<Object, Boolean>();
171 >        ConcurrentHashMap<Object, Boolean> m = new ConcurrentHashMap<>();
172          for (int i = 0; i < size; i++) {
173              m.put(Collections.singletonList(new BI(i)), true);
174          }
175  
176          for (int i = 0; i < size; i++) {
177 <            LexicographicList<BI> bis = new LexicographicList<BI>(new BI(i));
177 >            LexicographicList<BI> bis = new LexicographicList<>(new BI(i));
178              assertTrue(m.containsKey(bis));
179          }
180      }
# Line 188 | Line 185 | public class ConcurrentHashMapTest exten
185       */
186      public void testMixedComparable() {
187          int size = 1200;        // makes measured test run time -> 35ms
188 <        ConcurrentHashMap<Object, Object> map =
192 <            new ConcurrentHashMap<Object, Object>();
188 >        ConcurrentHashMap<Object, Object> map = new ConcurrentHashMap<>();
189          Random rng = new Random();
190          for (int i = 0; i < size; i++) {
191              Object x;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines