Back to Intellij Community

GroovyVariableCanBeFinal

plugins/groovy/groovy-psi/resources/inspectionDescriptions/GroovyVariableCanBeFinal.html

2025.3-rc-2268 B
Original Source

Reports parameters or local variables that may have a final modifier added.

Example:

def list = [1,2,3]
  return list

After the quick-fix is applied:

final def list = [1,2,3]
  return list

For more information, see the same inspection in Java.