Groovy
Local variable is reassigned in closure or anonymous class
Warning
Reliability
New
Last modified: 03 December 2024Reports local variables assigned to expression with different type inside of closure or anonymous class.
Example:
int sum = 0
[1, 2, 3].each { sum += 'as' }
println(sum)
As a result, the integer
variable sum is reassigned to a String
expression.
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
GrReassignedInClosureLocalVar
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Groovy, 243.23126 |
Thanks for your feedback!
Was this page helpful?