Stop Idea adding 'final' to every local variable
已回答
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
setting?
cheers,
-m
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.