Bug 365976

Summary: [clean up] Do not add final to parameters of abstract methods
Product: [Eclipse Project] JDT Reporter: jwnimmer
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert
Version: 3.8   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description jwnimmer CLA 2011-12-07 18:38:44 EST
Build Identifier: M20110909-1335

In the current code clean-up feature, there is a "Code Style" option for "Variable declarations" to "Use modifier 'final' where possible" with a checkbox for "Parameter".  When checked, this causes 'final' to be added to abstract method parameters (among other things).

For an abstract method, the 'final' modifier on a parameter makes no difference in functionality -- it is only a matter of taste.  All other additions of final by the code clean-up action are meaningful (they prevent re-assigning variables).

As such, I believe that the action should be changed to leave alone the presence or absence of "final" on abstract method parameters.  To satisfy matters of taste, there are already other bugs open about removing unnecessary keywords (#130888), or about user preferences about which unnecessary keywords should appear during code generation, etc.


Reproducible: Always
Comment 1 Dani Megert CLA 2011-12-14 05:13:22 EST
I agree with this. Our normal strategy is to not generate redundant modifiers.