Skip to content

Commit 5703be5

Browse files
authored
style: enable EqualsHashCode in checkstyle (#5157)
1 parent 319d514 commit 5703be5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

checkstyle.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
<!-- Checks for common coding problems -->
162162
<!-- See https://checkstyle.org/checks/coding/index.html -->
163163
<module name="EmptyStatement"/>
164-
<!-- TODO <module name="EqualsHashCode"/> -->
164+
<module name="EqualsHashCode"/>
165165
<!-- TODO <module name="HiddenField"/> -->
166166
<module name="IllegalInstantiation"/>
167167
<!-- TODO <module name="InnerAssignment"/> -->

src/main/java/com/thealgorithms/datastructures/trees/KDTree.java

+5
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ public boolean equals(Object obj) {
8181
return false;
8282
}
8383

84+
@Override
85+
public int hashCode() {
86+
return Arrays.hashCode(coordinates);
87+
}
88+
8489
@Override
8590
public String toString() {
8691
return Arrays.toString(coordinates);

0 commit comments

Comments
 (0)