jbonofre commented on code in PR #4056:
URL: https://github.com/apache/polaris/pull/4056#discussion_r2992473954


##########
persistence/nosql/persistence/api/src/main/java/org/apache/polaris/persistence/nosql/api/index/IndexElem.java:
##########
@@ -58,8 +73,9 @@ public boolean equals(Object o) {
     if (o == this) {
       return true;
     }
-    if (o instanceof Index.Element<?> other) {
-      return key.equals(other.key()) && value.equals(other.value());
+    if (o instanceof IndexElem<?> other) {

Review Comment:
   For context (if other reviewers are asking), this is a change in the 
semantic here.
   The "old" `IndexElem` (record) compared against any `Index.Element<?>`, but 
the new implementation only matches `instanceof IndexElem<?>`. This means a 
third-party `Index.Element` implementation that isn't an `IndexElem` subclass 
will no longer be considered equal, even with the same key/value.
   
   The "old" `AbstractIndexElement` also had a fallback to `Index.Element<?>`.
   
   This is an intentional "breaking change". Maybe worth to add a comment here 
to avoid "surprising" the reviewers 😄 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to