Bug 229527 - [code style] configure if new fields should be final by default
Summary: [code style] configure if new fields should be final by default
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3.2   Edit
Hardware: PC Linux
: P4 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-29 22:32 EDT by Robert Konigsberg CLA
Modified: 2014-02-05 02:01 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 Robert Konigsberg CLA 2008-04-29 22:32:00 EDT
I rely on the "Create Field" quick fix to create a field for me. I like that it makes my field private by default. I'd like it to be 'private final' by default. Not only would that encourage good practice (OK, that's just my opinion, bit I know it's other peoples' opinion too) but it would keep me from having to navigate up to the new attribute and add it myself.
Comment 1 Benno Baumgartner CLA 2008-04-30 04:16:03 EDT
(In reply to comment #0)
>  but it would keep me from
> having to navigate up to the new attribute and add it myself.

Maybe the 'Add final modifier to private fields' save action can help you: Preferences > Java > Editor > Save Actions

Comment 2 Martin Aeschlimann CLA 2008-04-30 06:45:36 EDT
I think that would be new code style setting, like for bug 40078.
Comment 3 Robert Konigsberg CLA 2008-04-30 13:26:44 EDT
Benno:

> Maybe the 'Add final modifier to private fields' save action can
> help you:
> Preferences > Java > Editor > Save Actions

I don't actually use the Save Actions, I'd prefer it in the Quick Fix personally because then the issue is done. Make sense?
Comment 4 Robert Konigsberg CLA 2008-04-30 13:27:21 EDT
Martin:

Yes, it's like 40078, but oh dear, I don't want my method parameters final. :)
Comment 5 Martin Aeschlimann CLA 2008-05-01 07:15:02 EDT
Sure, bug 40078 is a different issue, but the two will be most likely be fixed in one pass.
But I must admit, this is not on our top priority list, as it it will be quite some work to bring all quick fixes, code generation and refactorings to follow the new preferences.
Comment 6 Robert Konigsberg CLA 2008-05-02 12:35:14 EDT
I forget off the top of my head how quick fixes work, but IIRC, maybe I could create my own Quick Fix based on the original one.