rspec/rules/S3974/java/rule.adoc

34 lines
674 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
"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.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,java]
2021-04-28 16:49:39 +02:00
----
public void equals(MyObject o) { // Noncompliant
//...
}
public bool equals(MyObject left, MyObject right) { // Noncompliant
// ...
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]