Code Inspection: Unused assignment
Reports a variable whose value is never used after assignment.
Suggests removing the unused variable to shorten the code and to avoid redundant allocations.
The following cases are reported:
A variable is never read after assignment.
The value of a variable is always overwritten with another assignment before the variable is read next time.
The initializer of a variable is redundant (for one of the above-mentioned reasons).
Suppress an inspection in the editor
Place the caret at the highlighted line and press Alt+Enter or click .
Click the arrow next to the inspection you want to suppress and select the necessary suppress action.
Last modified: 25 March 2024