Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6431628
Votes 1
Synopsis Generics support in the concurrency package
Category java:classes_util_concurrent
Reported Against
Release Fixed
State 3-Accepted, request for enhancement
Priority: 4-Low
Related Bugs
Submit Date 30-MAY-2006
Description
A DESCRIPTION OF THE REQUEST :
The concurrency package lacks the ability to use Generics.

JUSTIFICATION :
The ThreadPoolExecutor has these nice methods which are intended to be overridden that can give you some information about the state of a Runnable. The method "void afterExecute(Runnable r, Throwable t)" is one of those methods.

I usually create some specific type of Runnable, for instance: a Job. My ThreadPool only consists of these Jobs. So if I want to access some specific method of my Job class I would need to cast the Runnable to Job.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would like to see that I can specify the type of Runnable by the use of generics. So I want to create a "new ThreadPoolExecutor < Job >(...)".
ACTUAL -
No generics :)

---------- BEGIN SOURCE ----------
public class ThreadPoolExecutor<E extends Runnable> extends AbstractExecutorService<E> {
    
    private final BlockingQueue<E> workQueue;

    protected void afterExecute(E r, Throwable t) { }
}
---------- END SOURCE ----------
Posted Date : 2006-05-30 11:14:41.0
Work Around
N/A
Evaluation
It's too late to generify ThreadPoolExecutor.
Posted Date : 2006-05-30 14:09:17.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang