Bug 54980

Summary: [quick fix] supporting cast to related types
Product: [Eclipse Project] JDT Reporter: Jens Odborg <jens.odborg>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert
Version: 3.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Jens Odborg CLA 2004-03-16 12:39:37 EST
e.g.
class Ancestor {}
class Derivered1 extends Ancestor {}
class Derivered2 extends Ancestor {}
class Container {
  Ancestor ancestor;
}
void f(Container c){
  g( c.ancestor/* when pressing ctrl-space here the listbox shoul include 
    2 entries called "Cast to derivered type >" and "Cast to base type >"
    selecting one of these should bring up a sub list of classes containing
    either "Derivered1" and "Derivered2" or "Object"
    selecting e.g. "Cast to derivered type >"."Derivered1"
    should transform the line to

  g( ((Derivered1)c.ancestor)

  */
  ...
}
Comment 1 Martin Aeschlimann CLA 2004-03-17 10:03:28 EST
code assist is more doing completions that assisting. Quick assist could help.
Will keep in mind, probably not for 3.0
Comment 2 Dani Megert CLA 2006-07-11 05:23:30 EDT
Discussed at the JDT Summit 2006:
- agreed that it should not go into code assist
- quick assist/fix could be triggered by "(x" and "(x." pattern