rspec/rules/S1223/rule.adoc
2022-02-04 16:28:24 +00:00

26 lines
496 B
Plaintext

Having a class and some of its methods sharing the same name is misleading, and leaves others to wonder whether it was done that way on purpose, or was the methods supposed to be a constructor.
== Noncompliant Code Example
[source,text]
----
public class Foo {
public Foo() {...}
public void Foo(String label) {...} // Noncompliant
}
----
== Compliant Solution
[source,text]
----
public class Foo {
public Foo() {...}
public void foo(String label) {...} // Compliant
}
----