Update pmd-java/src/main/resources/category/java/errorprone.xml

This commit is contained in:
Clément Fournier
2020-08-25 14:37:29 +02:00
committed by GitHub
parent af6969a29a
commit 0a18460234

View File

@ -3054,7 +3054,7 @@ StringBuilder sb4 = new StringBuilder("c");
<description>
The method name and parameter number are suspiciously close to Object.equals, which can denote an
intention to override it. However, the method does not override Object.equals, but overloads it instead.
Overloading Object.equals method is confusing for other programmers, error-prone and hard to main,
Overloading Object.equals method is confusing for other programmers, error-prone and hard to maintain,
especially when using inheritance, because @Override annotations used in subclasses can provide a false
sense of security. For more information on Object.equals method, see Effective Java, 3rd Edition,
Item 10: Obey the general contract when overriding equals.