Bug 374271 - [pull up] pull up into generic parent from concrete subclass should change concrete to generic types
Summary: [pull up] pull up into generic parent from concrete subclass should change co...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-14 12:23 EDT by jules CLA
Modified: 2012-04-09 14:29 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jules CLA 2012-03-14 12:23:22 EDT
Build Identifier: Version: Indigo Service Release 2 Build id: 20120216-1857

If I have a class that has a generic parent, e.g.:

public interface Parent<T> { }
public class Subclass implements Parent<String> { }

(or similarly with extending a generic class) and I execute the 'pull up' refactoring on a method that uses the concrete type (i.e. String in the example above) in its signature, it seems reasonable that it should change to the appropriate generic type. So if I have:

public class Parent<T> { }
public class Subclass extends Parent<String> { 
   public String getValue() { ... }
}

and I execute a pull up on getValue(), moving it to Parent, the result should be:

public class Parent<T> { 
   public T getValue() { ... }
}
public class Subclass extends Parent<String> { }

as long as making this change does not cause any compiler errors.  This should probably only be an option, and not compulsory behaviour.

Reproducible: Always