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

Comparing jsr166/src/test/tck/ForkJoinTaskTest.java (file contents):
Revision 1.58 by jsr166, Thu Jun 4 14:17:31 2020 UTC vs.
Revision 1.60 by dl, Tue Jan 26 13:33:06 2021 UTC

# Line 68 | Line 68 | public class ForkJoinTaskTest extends JS
68          }
69      }
70  
71 <    void checkNotDone(ForkJoinTask a) {
71 >    void checkNotDone(ForkJoinTask<?> a) {
72          assertFalse(a.isDone());
73          assertFalse(a.isCompletedNormally());
74          assertFalse(a.isCompletedAbnormally());
# Line 123 | Line 123 | public class ForkJoinTaskTest extends JS
123          assertSame(expectedValue, v2);
124      }
125  
126 <    void checkCancelled(ForkJoinTask a) {
126 >    void checkCancelled(ForkJoinTask<?> a) {
127          assertTrue(a.isDone());
128          assertTrue(a.isCancelled());
129          assertFalse(a.isCompletedNormally());
# Line 160 | Line 160 | public class ForkJoinTaskTest extends JS
160          } catch (Throwable fail) { threadUnexpectedException(fail); }
161      }
162  
163 <    void checkCompletedAbnormally(ForkJoinTask a, Throwable t) {
163 >    void checkCompletedAbnormally(ForkJoinTask<?> a, Throwable t) {
164          assertTrue(a.isDone());
165          assertFalse(a.isCancelled());
166          assertFalse(a.isCompletedNormally());
# Line 858 | Line 858 | public class ForkJoinTaskTest extends JS
858                  AsyncFib f = new AsyncFib(8);
859                  AsyncFib g = new AsyncFib(9);
860                  AsyncFib h = new AsyncFib(7);
861 <                HashSet set = new HashSet();
861 >                HashSet<ForkJoinTask<?>> set = new HashSet<ForkJoinTask<?>>();
862                  set.add(f);
863                  set.add(g);
864                  set.add(h);
# Line 898 | Line 898 | public class ForkJoinTaskTest extends JS
898              protected void realCompute() {
899                  AsyncFib f = new AsyncFib(8);
900                  FailingAsyncFib g = new FailingAsyncFib(9);
901 <                ForkJoinTask[] tasks = { f, g };
901 >                ForkJoinTask<?>[] tasks = { f, g };
902                  shuffle(tasks);
903                  try {
904                      invokeAll(tasks);
# Line 936 | Line 936 | public class ForkJoinTaskTest extends JS
936                  AsyncFib f = new AsyncFib(8);
937                  FailingAsyncFib g = new FailingAsyncFib(9);
938                  AsyncFib h = new AsyncFib(7);
939 <                ForkJoinTask[] tasks = { f, g, h };
939 >                ForkJoinTask<?>[] tasks = { f, g, h };
940                  shuffle(tasks);
941                  try {
942                      invokeAll(tasks);
# Line 957 | Line 957 | public class ForkJoinTaskTest extends JS
957                  FailingAsyncFib f = new FailingAsyncFib(8);
958                  AsyncFib g = new AsyncFib(9);
959                  AsyncFib h = new AsyncFib(7);
960 <                ForkJoinTask[] tasks = { f, g, h };
960 >                ForkJoinTask<?>[] tasks = { f, g, h };
961                  shuffle(tasks);
962                  try {
963                      invokeAll(Arrays.asList(tasks));
# Line 1527 | Line 1527 | public class ForkJoinTaskTest extends JS
1527                  AsyncFib f = new AsyncFib(8);
1528                  AsyncFib g = new AsyncFib(9);
1529                  AsyncFib h = new AsyncFib(7);
1530 <                HashSet set = new HashSet();
1530 >                HashSet<ForkJoinTask<?>> set = new HashSet<ForkJoinTask<?>>();
1531                  set.add(f);
1532                  set.add(g);
1533                  set.add(h);
# Line 1567 | Line 1567 | public class ForkJoinTaskTest extends JS
1567              protected void realCompute() {
1568                  AsyncFib f = new AsyncFib(8);
1569                  FailingAsyncFib g = new FailingAsyncFib(9);
1570 <                ForkJoinTask[] tasks = { f, g };
1570 >                ForkJoinTask<?>[] tasks = { f, g };
1571                  shuffle(tasks);
1572                  try {
1573                      invokeAll(tasks);
# Line 1605 | Line 1605 | public class ForkJoinTaskTest extends JS
1605                  AsyncFib f = new AsyncFib(8);
1606                  FailingAsyncFib g = new FailingAsyncFib(9);
1607                  AsyncFib h = new AsyncFib(7);
1608 <                ForkJoinTask[] tasks = { f, g, h };
1608 >                ForkJoinTask<?>[] tasks = { f, g, h };
1609                  shuffle(tasks);
1610                  try {
1611                      invokeAll(tasks);
# Line 1626 | Line 1626 | public class ForkJoinTaskTest extends JS
1626                  FailingAsyncFib f = new FailingAsyncFib(8);
1627                  AsyncFib g = new AsyncFib(9);
1628                  AsyncFib h = new AsyncFib(7);
1629 <                ForkJoinTask[] tasks = { f, g, h };
1629 >                ForkJoinTask<?>[] tasks = { f, g, h };
1630                  shuffle(tasks);
1631                  try {
1632                      invokeAll(Arrays.asList(tasks));
# Line 1694 | Line 1694 | public class ForkJoinTaskTest extends JS
1694          }
1695      }
1696  
1697 <    /**
1698 <     * adaptInterruptible(callable).toString() contains toString of wrapped task
1699 <     */
1700 <    public void testAdaptInterruptible_Callable_toString() {
1701 <        if (testImplementationDetails) {
1702 <            Callable<String> c = () -> "";
1703 <            ForkJoinTask<String> task = ForkJoinTask.adaptInterruptible(c);
1704 <            assertEquals(
1705 <                identityString(task) + "[Wrapped task = " + c.toString() + "]",
1706 <                task.toString());
1707 <        }
1708 <    }
1697 >    // adaptInterruptible deferred to its own independent change
1698 >    // https://bugs.openjdk.java.net/browse/JDK-8246587
1699 >
1700 > //     /**
1701 > //      * adaptInterruptible(callable).toString() contains toString of wrapped task
1702 > //      */
1703 > //     public void testAdaptInterruptible_Callable_toString() {
1704 > //         if (testImplementationDetails) {
1705 > //             Callable<String> c = () -> "";
1706 > //             ForkJoinTask<String> task = ForkJoinTask.adaptInterruptible(c);
1707 > //             assertEquals(
1708 > //                 identityString(task) + "[Wrapped task = " + c.toString() + "]",
1709 > //                 task.toString());
1710 > //         }
1711 > //     }
1712   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines