32 lines
469 B
Plaintext
32 lines
469 B
Plaintext
![]() |
The use of the ``++this++`` keyword is only required when the member is shadowed by a local parameter, or variable. In other cases, the code should be simplified by its removal.
|
||
|
|
||
|
|
||
|
== Noncompliant Code Example
|
||
|
|
||
|
----
|
||
|
public class MyClass
|
||
|
{
|
||
|
private int count;
|
||
|
|
||
|
public void DoSomething() {
|
||
|
this.count++; // Noncompliant
|
||
|
}
|
||
|
}
|
||
|
----
|
||
|
|
||
|
|
||
|
== Compliant Solution
|
||
|
|
||
|
----
|
||
|
public class MyClass
|
||
|
{
|
||
|
private int count;
|
||
|
|
||
|
public void DoSomething() {
|
||
|
count++;
|
||
|
}
|
||
|
}
|
||
|
----
|
||
|
|
||
|
|