Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 123421 - [quick assist] assign all parameters to new fields
Summary: [quick assist] assign all parameters to new fields
Status: CLOSED DUPLICATE of bug 318681
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-11 08:50 EST by Channing Walton CLA
Modified: 2010-11-12 10:57 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Channing Walton CLA 2006-01-11 08:50:21 EST
It would be nice to extend the quick fix for assigning a parameter to a new field, to optionally assign all parameters to new fields.
Comment 1 Martin Aeschlimann CLA 2006-01-12 06:59:38 EST
I understand what you mean, but that's one of these cases where I think we end up with too many alternative proposals.

Also consider to use the 'Create constructor from fields' wizard.
Comment 2 Channing Walton CLA 2006-01-13 01:35:22 EST
Sure. However, this is the kind of thing that people coming from IntelliJ find surprising and give fuel to their argument that eclipse isn't as good - something I hear on a daily basis at work.
Comment 3 Martin Aeschlimann CLA 2006-01-13 04:13:47 EST
You have to convince me that this is a case that deserves an own quick fix proposal. What about the combination of parameters, ect (or is the idea to present a dialog?)
Comment 4 Channing Walton CLA 2006-01-13 09:29:58 EST
I think my original request above is ambiguous.

The scenario that I always come across is that I want to assign all the arguments of a new constructor to new fields. To do this at present, I go to each argument in turn using a quick fix to create the field and assign it.

So the quick fix would be to repeatedly apply the current quick fix to each field in turn. Would that result in too many proposals?
Comment 5 Martin Aeschlimann CLA 2006-01-16 09:20:20 EST
I guess just one 'Assign all parameters to fields' is ok.
Comment 6 Markus Keller CLA 2006-01-24 10:14:22 EST
I could have sworn I already saw/filed a similar bug, but I can't find it. My use case is this:

- Write code like this, where class Container does not yet exist.
    void m() {
        new Container("Hello", 2, null);
    }

- use quick fix to create class Container
- use quick fix to create constructor Container(String, int, Object)
- for each parameter, use quick fix to assign to new field

'Assign all parameters to fields' would simplify the last step.
Comment 7 Deepak Azad CLA 2010-11-12 10:57:22 EST

*** This bug has been marked as a duplicate of bug 318681 ***