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

Comparing jsr166/src/test/tck/LinkedBlockingDequeTest.java (file contents):
Revision 1.82 by jsr166, Fri Aug 4 03:30:21 2017 UTC vs.
Revision 1.83 by jsr166, Mon May 28 21:19:50 2018 UTC

# Line 1543 | Line 1543 | public class LinkedBlockingDequeTest ext
1543       */
1544      public void testToArray() throws InterruptedException {
1545          LinkedBlockingDeque q = populatedDeque(SIZE);
1546 <        Object[] o = q.toArray();
1547 <        for (int i = 0; i < o.length; i++)
1548 <            assertSame(o[i], q.poll());
1546 >        Object[] a = q.toArray();
1547 >        assertSame(Object[].class, a.getClass());
1548 >        for (Object o : a)
1549 >            assertSame(o, q.poll());
1550 >        assertTrue(q.isEmpty());
1551      }
1552  
1553      /**
# Line 1556 | Line 1558 | public class LinkedBlockingDequeTest ext
1558          Integer[] ints = new Integer[SIZE];
1559          Integer[] array = q.toArray(ints);
1560          assertSame(ints, array);
1561 <        for (int i = 0; i < ints.length; i++)
1562 <            assertSame(ints[i], q.remove());
1561 >        for (Integer o : ints)
1562 >            assertSame(o, q.remove());
1563 >        assertTrue(q.isEmpty());
1564      }
1565  
1566      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines