IntelliJ IDEA Adds Finale to Auto Generators

I am trying to add the last keyword to the parameters in my auto-generated setters in IntelliJ IDEA 14. I know that I can create a copy of the current template that is used for setter methods:

#set($paramName = $helper.getParamName($field, $project)) public ## #if($field.modifierStatic) static ## #end void set$StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))($field.type $paramName) { #if ($field.name == $paramName) #if (!$field.modifierStatic) this.## #else $classname.## #end #end $field.name = $paramName; } 

But even after several hours of working with it, I can’t understand how to add the β€œfinal” to it and make it work in IntelliJ.

+5
source share
1 answer

You do not need to do this with templates.

Go to Settings (Windows: Ctrl + Alt + S ) / Preferences (Mac: Command + , )

  • Editor | Code Style | Java
  • Select the Code Generation tab
  • Tick Make generated parameters final
+11
source

All Articles