Bug 185023 - [refactoring] Refactoring for parameterizing Java classes (add generic type parameters)
Summary: [refactoring] Refactoring for parameterizing Java classes (add generic type p...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-01 21:56 EDT by Andrew CLA
Modified: 2022-11-07 18:23 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew CLA 2007-05-01 21:56:48 EDT
Adam Kiezun et al. have written a paper with the above title about their work to implement refactorings involving generics which greatly assist in migrating from Java 1.4 to Java 1.5 (see http://people.csail.mit.edu/akiezun/icse07-final.pdf). Note that their prototype was implemented as Eclipse plugin(s). Adam Kiezun (who previously worked in the JDT UI team) believes that a simpler set of refactorings could be implemented with substantially less effort but which still bring most of the benefits of their research prototype.
Comment 1 Martin Aeschlimann CLA 2007-05-02 03:46:18 EDT
Adam, are interested in integrate your implementation into JDT?
Comment 2 Adam Kiezun CLA 2010-11-29 11:24:31 EST
(In reply to comment #1)
> Adam, are interested in integrate your implementation into JDT?

Sorry, Somehow I missed this question when it was asked. The integration is unfortunately not going to be feasible for me to do at this point - the code changes were quite extensive and developed for a long-superseded version of Eclipse. The main complexity came from propagating the type parameters across classes. It should be possible to develop a simpler 1-class parameterization, which would not be as general and applicable, but should cover the most common cases.
Comment 3 Axel Uhl CLA 2022-11-07 09:46:13 EST
IntelliJ supports this since long. Not being able to change a type parameter list, especially remove a type parameter, and add a type parameter while providing a default type for all existing instantiations, is obviously creating a per-instantiation effort which discourages the use of parameterized types in the first place. Is this bug maybe assigned or catagorized incorrectly and hence hasn't been discovered in years?
Comment 4 Jeff Johnston CLA 2022-11-07 18:23:18 EST
(In reply to Axel Uhl from comment #3)
> IntelliJ supports this since long. Not being able to change a type parameter
> list, especially remove a type parameter, and add a type parameter while
> providing a default type for all existing instantiations, is obviously
> creating a per-instantiation effort which discourages the use of
> parameterized types in the first place. Is this bug maybe assigned or
> catagorized incorrectly and hence hasn't been discovered in years?

Case of age and missing info.

I think had the original prototype been submitted at the time, it might have been straight-forward to integrate a solution into Eclipse JDT at the time.  Even if the prototype were submitted today, it would immensely reduce the resources needed to implement a full modern solution.

JDT has since moved to github and there is a back-log of older bugs such as these as bugs were not automatically moved over.  The audience of such bugs is becoming less and less.

I think it would be reasonable to open a new enhancement issue to parameterize a single class as alluded to by Andrew and Adam.  Any other related Intellij features you are looking for could also be added as enhancement issue requests but no guarantees on available resources to do so.