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.
Summary: | Automatically added final modifiers | ||
---|---|---|---|
Product: | java | Reporter: | gualtiero65 |
Component: | Hints | Assignee: | Jan Lahoda <jlahoda> |
Status: | REOPENED --- | ||
Severity: | normal | CC: | russkiy |
Priority: | P3 | ||
Version: | 7.0.1 | ||
Hardware: | PC | ||
OS: | Linux | ||
URL: | http://twelve-programmers.blogspot.com/2008/04/automatically-add-final-modifier-to.html | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
gualtiero65
2011-08-29 16:52:55 UTC
*** This bug has been marked as a duplicate of bug 125566 *** Although netbean now hints that a field can be declared as final, this is not sufficient as the original poster had requested final to be added everywhere including "local variables" and "method parameters" (as is the case in eclipse). Also hinting alone is not sufficient. It'd be much nicer if netbean could automatically add final wherever possible (add it as an option to onSave actions instead of hint). This is also the case in eclipse. For these reasons I'm re-opening this issue. IntelliJ also allows this: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206185619-Auto-add-the-final-modifier-to-newly-declared-variables-values Here is an idea for an additional feature that will help Netbeans stand even higher above Eclipse/IntelliJ. Allow the user (me!) to set a font color for non-final variables and optionally hide the final keyword all together (i.e. it's not displayed in the IDE!). E.g. say 'orange' (for me) represents all non-final variables, that's my chosen visual representation for non-final variables, done :) The 'final' attribute can then be cleanly added to the popup that already shows the variable type (cursor on variable, ctrl + space to see that popup). Thanks for reading! |