A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/4546 below:

[java] OverrideBothEqualsAndHashCode ignores records · Issue #4546 · pmd/pmd · GitHub

Affects PMD Version: 7.0.0-rc2 and 6.x

Rule: OverrideBothEqualsAndHashCode

Please provide the rule name and a link to the rule documentation:
https://docs.pmd-code.org/latest/pmd_rules_java_errorprone.html#overridebothequalsandhashcode

Description:

Code Sample demonstrating the issue:

record Foo(int x) {
   @Override boolean equals(Object o) { return this == o; }
}

Expected outcome:

PMD should report a violation at line ..., but doesn't. This is a false-negative.

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4