I try to avoid having non-final variables when possible, and it would save some typing if Eclipse would automate this for me (also so I don’t forget to do it). What I’d like is for it to detect when I add a new variable assignment/declaration statement, and as soon as I finish it, insert the final modifier.
Is there a configuration option or lightweight plugin that would accomplish this?
You can add it as a ‘Save Action‘ so that whenever you save a file, Eclipse will add
finalto your variables. This is how:‘final’ where possible. You can choose between private fields, parameters and local variables.
Or you can do the same thing manually (every once in while or for existing code base) via Clean up