
org.sonar.l10n.squidjava.rules.squid.S1221.html Maven / Gradle / Ivy
Naming a method hashcode()
is either:
- A bug. Overriding
Object.hashCode()
was meant and the application does not behave as expected.
- Done on purpose. The name however will confuse every other developer, who will think it is a bug.
In both cases, the method should be renamed.
The following code:
public int hashcode() { /* ... */ } // Non-Compliant
should be refactored into:
@Override
public int hashCode() { /* ... */ } // Compliant
© 2015 - 2025 Weber Informatics LLC | Privacy Policy