style: enable EqualsHashCode in checkstyle (#5157)

This commit is contained in:
Godwill Christopher 2024-05-12 03:38:07 -06:00 committed by GitHub
parent 319d5143cc
commit 5703be5953
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -161,7 +161,7 @@
<!-- Checks for common coding problems --> <!-- Checks for common coding problems -->
<!-- See https://checkstyle.org/checks/coding/index.html --> <!-- See https://checkstyle.org/checks/coding/index.html -->
<module name="EmptyStatement"/> <module name="EmptyStatement"/>
<!-- TODO <module name="EqualsHashCode"/> --> <module name="EqualsHashCode"/>
<!-- TODO <module name="HiddenField"/> --> <!-- TODO <module name="HiddenField"/> -->
<module name="IllegalInstantiation"/> <module name="IllegalInstantiation"/>
<!-- TODO <module name="InnerAssignment"/> --> <!-- TODO <module name="InnerAssignment"/> -->

View File

@ -81,6 +81,11 @@ public class KDTree {
return false; return false;
} }
@Override
public int hashCode() {
return Arrays.hashCode(coordinates);
}
@Override @Override
public String toString() { public String toString() {
return Arrays.toString(coordinates); return Arrays.toString(coordinates);