In constructors I very often assign to a non-existing field and choose Ctrl+1 "Create field 'memberField' in type 'CurrentType'".
The problem is that I want the field to be final by default, which it isn't. Is there a template for this quick fix somewhere? Thanks.
解决方案
I didn't see any obvious way to do that through code template, perhaps because this is not the Java language default.
While there are blog posts out there advocating for Data immutability by default, this is not the default style in use, as in has been previously debated in SO (or in many other SO questions)
However, you can modify the Cleanup process (occurring on each save if you want):
Java > Code Style > CleanUp > Code Style
and select Use modifier 'final' where possible.