Bug 46939 - [change method signature] let default value refer to existing parameter
Summary: [change method signature] let default value refer to existing parameter
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-19 05:53 EST by Martin Aeschlimann CLA
Modified: 2006-06-13 07:22 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 Martin Aeschlimann CLA 2003-11-19 05:53:48 EST
20031119

In the 'Refactoring > Change Method Signature' dialog, for existing parameters
it's not possible to enter a default value. This should be made more clear by
dispabling the corresponding cell or to add some non editable text like '(existing)'

As an extra it would be nice if the default value could refer to an exising
argument e.g. ${v}.toString();

example:
  public void foo(Value value) {
  }
changed to
  public void foo(Value value, String description) {
  }
I set the default value of description to
  '${value}.getDescription()'

An caller of foo: 'foo(colorValue)' is then changed to
'foo(colorValue, colorValue.getDescription())'
Comment 1 Markus Keller CLA 2004-04-15 04:08:43 EDT
Non-editable default cells have a '-' now.
Adapting summary from "Change method signature: Issues with default value".

We need an affordance if we support templates for existing parameters.
Could use content assist:
 ${value} - copy actual argument of parameter 'value'

The "perfect" solution could even support content assist after the ${value}
expression.