24 lines
539 B
Plaintext
24 lines
539 B
Plaintext
"equals" has a special place as a method name: it is expected to override ``++boolean Object.equals(Object)++``. Using the name for a method with some other signature is a recipe for confusion.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
public void equals(MyObject o) { // Noncompliant
|
|
//...
|
|
}
|
|
|
|
public bool equals(MyObject left, MyObject right) { // Noncompliant
|
|
// ...
|
|
}
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|