Text of codeql.github.com › codeql-query-help › java › java-hashcode-typo as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

Typo in hashCode — CodeQL query help documentation

CodeQL query help documentation » CodeQL query help for Java and Kotlin » Typo in hashCode ¶ ID: java/hashcode-typo Kind: problem Security severity: Severity: warning Precision: medium Tags: - quality - reliability - correctness - readability Query suites: - java-security-and-quality.qls Click to see the query in the CodeQL repository A method named hashcode may be a typographical error. hashCode (different capitalization) may have been intended instead.

Recommendation ¶ Ensure that any such method is intended to have this name. Even if it is, it may be better to rename it to avoid confusion with the inherited method Object.hashCode . Example ¶ The following example shows a method named hashcode . It may be better to rename it. public class Person { private String title ; private String forename ; private String surname ; // ... public int hashcode () { // The method is named 'hashcode'. int hash = 23 * title . hashCode (); hash ^= 13 * forename . hashCode (); return hash ^ surname . hashCode (); } } References ¶ Java API Specification: Object.hashCode . © GitHub, Inc.

Terms Privacy