rspec/rules/S3974/java/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

43 lines
704 B
Plaintext

== Why is this an issue?
"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
[source,java]
----
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)
=== Message
Rename this method.
=== Highlighting
``++equals++``
'''
== Comments And Links
(visible only on this page)
=== relates to: S1201
endif::env-github,rspecator-view[]