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

Bug 298294

Summary: [extract method] extracting a method which sets final fields from constructor should remove the final
Product: [Eclipse Project] JDT Reporter: Zviki Cohen <zvikico>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: minor    
Priority: P3 CC: markus.kell.r
Version: 3.6   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Zviki Cohen CLA 2009-12-21 07:56:55 EST
Build Identifier: 3.5.1

Here's a common scenario: a constructor sets a field with a value. The field is only modified inside the constructor, thus it is final (in my case, I use Save Acitons to declare this final automatically). 

Now, I want to extract the field setting logic to a method. The field cannot be final in this case. The extraction will work, but the field will remain final and, thus, create a compilation error. 

Ideally, the final should be removed at this point.

Reproducible: Always

Steps to Reproduce:
See details.
Comment 1 Markus Keller CLA 2010-01-25 10:00:22 EST

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