Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 130922

Summary: [quick assist] 'Assign parameter to new field' must not make field final'
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, markus.kell.r, milesparker, stanio
Version: 3.2   
Target Milestone: 3.8 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2006-03-08 11:02:23 EST
I20060307-1315

package xy;
public class Try{
    public Try(String arg) {
        
    }
    public Try() {
        
    }
}

Quick assist on 'arg' to assign to a new field
-> field is final, yielding a compile error
-> expected: field not final as it was in earlier builds
Comment 1 Martin Aeschlimann CLA 2006-03-12 17:28:17 EST
That these fields are created final has been there for quite a while (maybe 3.0). I even think to have an error here is a good thing, as you really also have to initialize the field in the other constructor/
Comment 2 Dani Megert CLA 2011-05-02 03:50:45 EDT
I agree with Markus. This got broken by fix for bug 42328.

People who want their fields 'final' can use the Save Action.
Comment 3 Miles Parker CLA 2011-05-02 16:23:40 EDT
Thanks Dani for the tip! All this time I thought it was just me that was bugged by this. :D
Comment 4 Markus Keller CLA 2012-04-16 13:50:34 EDT
The field is not made final any more, unless the class has only a single constructor and the "Add final modifier to private fields" cleanup is enabled as Save Action.

http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=e1164504c89003e2a6ee1c3c312ae6247c431cfb