16 lines
383 B
Plaintext
16 lines
383 B
Plaintext
![]() |
Having two methods in the same class with the same body is suspicious and potentially confusing. If it is due to a bad copy/paste, it should be fixed. If it's on purpose, it is clearer for the second method to simply call the first.
|
||
|
|
||
|
|
||
|
== Noncompliant Code Example
|
||
|
|
||
|
----
|
||
|
public void doTheThing() {
|
||
|
this.x = 4;
|
||
|
}
|
||
|
|
||
|
public void doTheOtherThing { // Noncompliant
|
||
|
this.x = 4;
|
||
|
}
|
||
|
----
|
||
|
|