org.sonar.l10n.java.rules.squid.S1656.html Maven / Gradle / Ivy
The newest version!
There is no reason to re-assign a variable to itself. Either this statement is redundant and should be removed, or the re-assignment is a mistake and some other value or variable was intended for the assignment instead.
Noncompliant Code Example
public void setName(String name) {
name = name;
}
Compliant Solution
public void setName(String name) {
this.name = name;
}
See
- CERT, MSC12-C - Detect and remove code that has no effect
- CERT, MSC12-CPP - Detect and remove code that has no effect
© 2015 - 2025 Weber Informatics LLC | Privacy Policy