This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
In Eclipse, the formatter/code cleanup functionality is capable of discovering when it is possible to make a field final (e.g. the field is private and never reassigned). As final fields are fantastic for visibility in concurrency and anonymous inner classes, it would be productive if NetBeans did a similar code cleanup.
Has this anyone been assigned to anyone? I think it's a fairly major oversight of NetBeans not to have this support... it's in Eclipse and almost everybody I know uses it and would miss it dearly if they came over to NetBeans.
Jan, do we have "add final" hint? Can it be applied as part of inspect and transform? If so this ENH might be closed as implemented (???).
I don't think we have such a hint, but it surely can be added.
*** Bug 201406 has been marked as a duplicate of this bug. ***
@Jan: I guess there is no change to get this feature in 7.3?! Will you please set the target version to PLAN or NEXT?
(In reply to comment #5) > @Jan: I guess there is no change to get this feature in 7.3?! Will you please > set the target version to PLAN or NEXT? Typo: @Jan: I guess there is no chance to get this feature in 7.3?! Will you please set the target version to PLAN or NEXT?
(In reply to comment #6) > (In reply to comment #5) > > @Jan: I guess there is no change to get this feature in 7.3?! Will you please > > set the target version to PLAN or NEXT? > > Typo: @Jan: I guess there is no chance to get this feature in 7.3?! Will you Correct - 7.3 is feature frozen for a long time, and is "code frozen" since last week, so unfortunately no chance to add any stuff unless it is a stopper. Trunk is not open for feature integrations yet, but I created a private branch that I intend to merge into trunk once it will be open for features, and tried to implement a "field can be made final" hint there: http://hg.netbeans.org/jet-main/rev/a8007ad79e19 > please set the target version to PLAN or NEXT?
Integrated into 'main-golden', will be available in build *201301290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/a8007ad79e19 User: Jan Lahoda <jlahoda@netbeans.org> Log: #125566: hint "field can be final".
In daily builds now.
I see (in 7.4 RC2) this is implemented for fields (controlled by Preferences > Editor > Hints > (Language: Java) # Threading # Field Can Be Final which is awesome. I think this feature would be even more useful if it could also make method parameters and local variables final (its implemented this way in Eclipse). This expanded functionality was specifically requested in duplicate https://netbeans.org/bugzilla/show_bug.cgi?id=201406 .