Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - generated method parameters final

Can Eclipse make parameters for generated methods (overwriting, implementing interface, etc.) final, and if so, how?

If I'm not mistaken, IntelliJ had an option for it. I could not find something similar in Eclipse.

I have become accustomed to making parameters final manually, but I am hoping for an automatic solution.

like image 912
JaanusSiim Avatar asked Oct 14 '08 07:10

JaanusSiim


1 Answers

AFAIK, that is not possible. I've not found any option to customize it under Window > Preferences > Java > Editor > Templates or under Window > Preferences > Java > Code Style > Code Templates.

Anyway, Eclipse 3.3+ comes with "save actions", an alternative mechanism for doing that. Under Preferencens > Java > Editors > Save actions it is possible to configure "additional save actions". On the code style tab there is an option to automatically add final modifiers to private fields, method parameters and local variables.

like image 139
Guido Avatar answered Sep 27 '22 23:09

Guido