Stop Idea adding 'final' to every local variable Follow Answered Nick Pratt Created January 02, 2011 18:02 How do I stop IDEA X adding the 'final' modifier to every local variable it inserts (under Mac OS X)?
You mean when you use the inline refactoring "Introduce variable"?
Press shift-tab until you are on the "final" and select the empty text instead. IDEA will remember it for the next time.
Thanks, that at least opens up the configuration. However, IDEA doesnt seem to remember the selection.
When I hit Shift+Tab x2 the 'final' modifier is highlighted, and I have a drop down with two options - 'final' and a blank entry.
I select the blank entry, hit return a couple of times, and I'm left with what I want (no final keyword on local variables).
I now repeat the procedure, but the final modifier is back by default, so IDEA hasnt remembered what I wanted.
Im using IDEA 10.0.1 on Mac OS X 10.6.5
did you tried settings > code style > code generation: mark local variables final
The setting did not work for me. Instead shift+tab, it's now a little popover with a checkbox when you declare a new variable using inline refactoring. It's easy to miss, but once you uncheck that it will remember.