rspec/rules/S2163/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

31 lines
898 B
Plaintext

== Why is this an issue?
An ``++equals++`` method that unconditionally returns the same answer is an error likely to cause many bugs.
=== Noncompliant code example
[source,java]
----
public class Fruit extends Food {
private Season ripe;
public boolean equals(Object obj) {
return ripe.equals(this); // Noncompliant
}
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
=== on 23 Mar 2018, 08:42:24 Alexandre Gigleux wrote:
\[~ann.campbell.2] Do you remember why this one has been closed "Won't Fix". It covers 2 FindBugs rules (EQ_ALWAYS_FALSE, EQ_ALWAYS_TRUE), that were not rejected according to \http://dist.sonarsource.com/reports/coverage/findbugs.html
=== on 23 Mar 2018, 13:00:50 Ann Campbell wrote:
I think it was in favor of the more sophisticated rules. I'm not finding a paper trail tho.
endif::env-github,rspecator-view[]