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

Comparing jsr166/src/test/tck/ExecutorCompletionService9Test.java (file contents):
Revision 1.6 by jsr166, Mon Oct 31 15:52:27 2016 UTC vs.
Revision 1.9 by jsr166, Wed Jan 27 01:57:24 2021 UTC

# Line 10 | Line 10 | import java.util.Collection;
10   import java.util.Comparator;
11   import java.util.List;
12   import java.util.Set;
13 import java.util.HashSet;
13   import java.util.concurrent.Callable;
14   import java.util.concurrent.CompletionService;
15   import java.util.concurrent.ExecutionException;
# Line 51 | Line 50 | public class ExecutorCompletionService9T
50          List<Future<Integer>> futures = new ArrayList<>(n);
51          Integer result = null;
52          try {
53 <            solvers.forEach((solver) -> futures.add(cs.submit(solver)));
53 >            solvers.forEach(solver -> futures.add(cs.submit(solver)));
54              for (int i = n; i > 0; i--) {
55                  try {
56                      Integer r = cs.take().get();
# Line 62 | Line 61 | public class ExecutorCompletionService9T
61                  } catch (ExecutionException ignore) {}
62              }
63          } finally {
64 <            futures.forEach((future) -> future.cancel(true));
64 >            futures.forEach(future -> future.cancel(true));
65          }
66  
67          if (result != null)
# Line 72 | Line 71 | public class ExecutorCompletionService9T
71      ArrayList<Integer> results;
72  
73      void use(Integer x) {
74 <        if (results == null) results = new ArrayList<Integer>();
74 >        if (results == null) results = new ArrayList<>();
75          results.add(x);
76      }
77  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines