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

Comparing jsr166/src/test/tck/RecursiveActionTest.java (file contents):
Revision 1.46 by jsr166, Sun Oct 18 04:48:32 2015 UTC vs.
Revision 1.47 by jsr166, Tue Aug 16 23:02:57 2016 UTC

# Line 258 | Line 258 | public class RecursiveActionTest extends
258          RecursiveAction a = new CheckedRecursiveAction() {
259              protected void realCompute() {
260                  FibAction f = new FibAction(8);
261 <                final Thread myself = Thread.currentThread();
261 >                final Thread currentThread = Thread.currentThread();
262  
263                  // test join()
264                  assertSame(f, f.fork());
265 <                myself.interrupt();
266 <                assertTrue(myself.isInterrupted());
265 >                currentThread.interrupt();
266 >                assertTrue(currentThread.isInterrupted());
267                  assertNull(f.join());
268                  Thread.interrupted();
269                  assertEquals(21, f.result);
# Line 272 | Line 272 | public class RecursiveActionTest extends
272                  f = new FibAction(8);
273                  f.cancel(true);
274                  assertSame(f, f.fork());
275 <                myself.interrupt();
276 <                assertTrue(myself.isInterrupted());
275 >                currentThread.interrupt();
276 >                assertTrue(currentThread.isInterrupted());
277                  try {
278                      f.join();
279                      shouldThrow();
# Line 285 | Line 285 | public class RecursiveActionTest extends
285                  f = new FibAction(8);
286                  f.completeExceptionally(new FJException());
287                  assertSame(f, f.fork());
288 <                myself.interrupt();
289 <                assertTrue(myself.isInterrupted());
288 >                currentThread.interrupt();
289 >                assertTrue(currentThread.isInterrupted());
290                  try {
291                      f.join();
292                      shouldThrow();
# Line 298 | Line 298 | public class RecursiveActionTest extends
298                  // test quietlyJoin()
299                  f = new FibAction(8);
300                  assertSame(f, f.fork());
301 <                myself.interrupt();
302 <                assertTrue(myself.isInterrupted());
301 >                currentThread.interrupt();
302 >                assertTrue(currentThread.isInterrupted());
303                  f.quietlyJoin();
304                  Thread.interrupted();
305                  assertEquals(21, f.result);
# Line 308 | Line 308 | public class RecursiveActionTest extends
308                  f = new FibAction(8);
309                  f.cancel(true);
310                  assertSame(f, f.fork());
311 <                myself.interrupt();
312 <                assertTrue(myself.isInterrupted());
311 >                currentThread.interrupt();
312 >                assertTrue(currentThread.isInterrupted());
313                  f.quietlyJoin();
314                  Thread.interrupted();
315                  checkCancelled(f);
# Line 317 | Line 317 | public class RecursiveActionTest extends
317                  f = new FibAction(8);
318                  f.completeExceptionally(new FJException());
319                  assertSame(f, f.fork());
320 <                myself.interrupt();
321 <                assertTrue(myself.isInterrupted());
320 >                currentThread.interrupt();
321 >                assertTrue(currentThread.isInterrupted());
322                  f.quietlyJoin();
323                  Thread.interrupted();
324                  checkCompletedAbnormally(f, f.getException());
# Line 358 | Line 358 | public class RecursiveActionTest extends
358              public void realRun() throws InterruptedException {
359                  FibAction[] fibActions = sq.take();
360                  FibAction f;
361 <                final Thread myself = Thread.currentThread();
361 >                final Thread currentThread = Thread.currentThread();
362  
363                  // test join() ------------
364  
365                  f = fibActions[0];
366                  assertFalse(ForkJoinTask.inForkJoinPool());
367 <                myself.interrupt();
368 <                assertTrue(myself.isInterrupted());
367 >                currentThread.interrupt();
368 >                assertTrue(currentThread.isInterrupted());
369                  assertNull(f.join());
370                  assertTrue(Thread.interrupted());
371                  assertEquals(21, f.result);
372                  checkCompletedNormally(f);
373  
374                  f = fibActions[1];
375 <                myself.interrupt();
376 <                assertTrue(myself.isInterrupted());
375 >                currentThread.interrupt();
376 >                assertTrue(currentThread.isInterrupted());
377                  try {
378                      f.join();
379                      shouldThrow();
# Line 383 | Line 383 | public class RecursiveActionTest extends
383                  }
384  
385                  f = fibActions[2];
386 <                myself.interrupt();
387 <                assertTrue(myself.isInterrupted());
386 >                currentThread.interrupt();
387 >                assertTrue(currentThread.isInterrupted());
388                  try {
389                      f.join();
390                      shouldThrow();
# Line 396 | Line 396 | public class RecursiveActionTest extends
396                  // test quietlyJoin() ---------
397  
398                  f = fibActions[3];
399 <                myself.interrupt();
400 <                assertTrue(myself.isInterrupted());
399 >                currentThread.interrupt();
400 >                assertTrue(currentThread.isInterrupted());
401                  f.quietlyJoin();
402                  assertTrue(Thread.interrupted());
403                  assertEquals(21, f.result);
404                  checkCompletedNormally(f);
405  
406                  f = fibActions[4];
407 <                myself.interrupt();
408 <                assertTrue(myself.isInterrupted());
407 >                currentThread.interrupt();
408 >                assertTrue(currentThread.isInterrupted());
409                  f.quietlyJoin();
410                  assertTrue(Thread.interrupted());
411                  checkCancelled(f);
412  
413                  f = fibActions[5];
414 <                myself.interrupt();
415 <                assertTrue(myself.isInterrupted());
414 >                currentThread.interrupt();
415 >                assertTrue(currentThread.isInterrupted());
416                  f.quietlyJoin();
417                  assertTrue(Thread.interrupted());
418                  assertTrue(f.getException() instanceof FJException);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines