I would like to setup my IntelliJ IDEA 14 for automatic final
keyword adding in all possible places (parameters, fields, etc.) to the existing Java class. I found some solutions with macros and shortcuts but I would like setup IntelliJ to add the final
keyword when it saves the file. Does anyone know a good solution for this? Maybe can you recommend some plugin or combination of plugins?
Open the "Configure inspections" view (click on the person in the hat icon). Search on "final" and you'll find various options in the code style section that you can enable to enable highlighting of candidates for final
. You can then use alt-return to apply the suggestion within a given file.
I wouldn't recommend you do it automatically on saving!