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

Comparing jsr166/src/test/tck/PhaserTest.java (file contents):
Revision 1.43 by jsr166, Mon Oct 5 22:38:38 2015 UTC vs.
Revision 1.44 by jsr166, Wed Jan 4 06:09:58 2017 UTC

# Line 302 | Line 302 | public class PhaserTest extends JSR166Te
302      public void testArrive2() {
303          final Phaser phaser = new Phaser();
304          assertEquals(0, phaser.register());
305 <        List<Thread> threads = new ArrayList<Thread>();
305 >        List<Thread> threads = new ArrayList<>();
306          for (int i = 0; i < 10; i++) {
307              assertEquals(0, phaser.register());
308              threads.add(newStartedThread(new CheckedRunnable() {
# Line 620 | Line 620 | public class PhaserTest extends JSR166Te
620      public void testAwaitAdvance4() {
621          final Phaser phaser = new Phaser(4);
622          final AtomicInteger count = new AtomicInteger(0);
623 <        List<Thread> threads = new ArrayList<Thread>();
623 >        List<Thread> threads = new ArrayList<>();
624          for (int i = 0; i < 4; i++)
625              threads.add(newStartedThread(new CheckedRunnable() {
626                  public void realRun() {
# Line 644 | Line 644 | public class PhaserTest extends JSR166Te
644          assertEquals(1, phaser.awaitAdvance(phaser.arrive()));
645          assertEquals(1, phaser.getPhase());
646          assertEquals(1, phaser.register());
647 <        List<Thread> threads = new ArrayList<Thread>();
647 >        List<Thread> threads = new ArrayList<>();
648          for (int i = 0; i < 8; i++) {
649              final CountDownLatch latch = new CountDownLatch(1);
650              final boolean goesFirst = ((i & 1) == 0);
# Line 672 | Line 672 | public class PhaserTest extends JSR166Te
672       */
673      public void testAwaitAdvanceTieredPhaser() throws Exception {
674          final Phaser parent = new Phaser();
675 <        final List<Phaser> zeroPartyChildren = new ArrayList<Phaser>(3);
676 <        final List<Phaser> onePartyChildren = new ArrayList<Phaser>(3);
675 >        final List<Phaser> zeroPartyChildren = new ArrayList<>(3);
676 >        final List<Phaser> onePartyChildren = new ArrayList<>(3);
677          for (int i = 0; i < 3; i++) {
678              zeroPartyChildren.add(new Phaser(parent, 0));
679              onePartyChildren.add(new Phaser(parent, 1));
680          }
681 <        final List<Phaser> phasers = new ArrayList<Phaser>();
681 >        final List<Phaser> phasers = new ArrayList<>();
682          phasers.addAll(zeroPartyChildren);
683          phasers.addAll(onePartyChildren);
684          phasers.add(parent);
# Line 720 | Line 720 | public class PhaserTest extends JSR166Te
720      public void testAwaitAdvance6() {
721          final Phaser phaser = new Phaser(3);
722          final CountDownLatch pleaseForceTermination = new CountDownLatch(2);
723 <        final List<Thread> threads = new ArrayList<Thread>();
723 >        final List<Thread> threads = new ArrayList<>();
724          for (int i = 0; i < 2; i++) {
725              Runnable r = new CheckedRunnable() {
726                  public void realRun() {
# Line 764 | Line 764 | public class PhaserTest extends JSR166Te
764          final Phaser phaser = new Phaser(1);
765          final int THREADS = 3;
766          final CountDownLatch pleaseArrive = new CountDownLatch(THREADS);
767 <        final List<Thread> threads = new ArrayList<Thread>();
767 >        final List<Thread> threads = new ArrayList<>();
768          for (int i = 0; i < THREADS; i++)
769              threads.add(newStartedThread(new CheckedRunnable() {
770                  public void realRun() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines