Menu

#180 rule: double assignment to local

open
nobody
None
5
2013-02-16
2011-01-24
No

SA: Double assignment of local variable (SA_LOCAL_DOUBLE_ASSIGNMENT)

This method contains a double assignment of a local variable; e.g.

public void foo() {
int x,y;
x = x = 17;
}

Assigning the same value to a variable twice is useless, and may indicate a logic error or typo.

Discussion


Log in to post a comment.