stargate / data-api

JSON document API for Apache Cassandra (formerly known as JSON API)
https://stargate.io
Apache License 2.0
13 stars 16 forks source link

Remove unnecessary (if so) `equals()`, `hashCode()` implementations from `IDFilterBase` sub-classes #1288

Closed tatu-at-datastax closed 1 month ago

tatu-at-datastax commented 2 months ago

Looks like 4 IDFilterBase Collection-related subtypes (f.ex. rc/main/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/filters/collection/IDCollectionFilter.java) implement equals() and hashCode(). But some other subtypes not. Further, table-backed filters don't implement.

It looks like either:

  1. Methods are not actually needed -- if so, remove (dead code)
  2. Methods are for some reason needed -- for testing? If so, need to document.
tatu-at-datastax commented 2 months ago

Based on @Yuqi-Du 's investigation, equals() needed by tests (to verify correct results), so should be left as-is, just adding comments.