A double assignment of a variable to itself has been detected. This may be a typo.
Check whether this is correct and edit it or remove the extra assignment.
When used as an expression, an assignment evaluates to the result of the RHS expression. For example, in the assignment a = 3
, Java would evaluate the result of the assignment as 3
.
Assigning a value to itself is redundant and does not achieve any benefits over assigning just the value of the RHS expression.
someVar = someVar = ...; // redundant!
It is likely that this was a typo. Perhaps the intention was to use a different variable in place of one of the repeated names.
someVar = someOtherVar = ...;
Alternatives
Consider changing this double assignment into two single, separate assignments on different lines.
someVar = ...;
someOtherVar = someVar;
This can have multiple benefits: