47 |
|
public void shutdown() { shutdown = true; } |
48 |
|
public List<Runnable> shutdownNow() { |
49 |
|
shutdown = true; |
50 |
< |
return Collections.EMPTY_LIST; |
50 |
> |
return Collections.emptyList(); |
51 |
|
} |
52 |
|
public boolean isShutdown() { return shutdown; } |
53 |
|
public boolean isTerminated() { return isShutdown(); } |
111 |
|
Runnable r = new CheckedRunnable() { |
112 |
|
public void realRun() throws Exception { |
113 |
|
ExecutorService e = new DirectExecutorService(); |
114 |
< |
Future future = e.submit(Executors.callable(new PrivilegedAction() { |
114 |
> |
Future<?> future = e.submit(Executors.callable(new PrivilegedAction<Object>() { |
115 |
|
public Object run() { |
116 |
|
return TEST_STRING; |
117 |
|
}})); |
132 |
|
Runnable r = new CheckedRunnable() { |
133 |
|
public void realRun() throws Exception { |
134 |
|
ExecutorService e = new DirectExecutorService(); |
135 |
< |
Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() { |
135 |
> |
Future<?> future = e.submit(Executors.callable(new PrivilegedExceptionAction<Object>() { |
136 |
|
public Object run() { |
137 |
|
return TEST_STRING; |
138 |
|
}})); |
150 |
|
Runnable r = new CheckedRunnable() { |
151 |
|
public void realRun() throws Exception { |
152 |
|
ExecutorService e = new DirectExecutorService(); |
153 |
< |
Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() { |
153 |
> |
Future<?> future = e.submit(Executors.callable(new PrivilegedExceptionAction<Object>() { |
154 |
|
public Object run() throws Exception { |
155 |
|
throw new IndexOutOfBoundsException(); |
156 |
|
}})); |
213 |
|
60, TimeUnit.SECONDS, |
214 |
|
new ArrayBlockingQueue<Runnable>(10)); |
215 |
|
try (PoolCleaner cleaner = cleaner(p)) { |
216 |
< |
Callable c = new Callable() { |
216 |
> |
Callable<Object> c = new Callable<Object>() { |
217 |
|
public Object call() { throw new ArithmeticException(); }}; |
218 |
|
try { |
219 |
|
p.submit(c).get(); |
584 |
|
e.invokeAll(tasks, timeout, MILLISECONDS); |
585 |
|
assertEquals(tasks.size(), futures.size()); |
586 |
|
assertTrue(millisElapsedSince(startTime) >= timeout); |
587 |
< |
for (Future future : futures) |
587 |
> |
for (Future<?> future : futures) |
588 |
|
assertTrue(future.isDone()); |
589 |
|
try { |
590 |
|
assertEquals("0", futures.get(0).get()); |