You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "absurdfarce (via GitHub)" <gi...@apache.org> on 2026/06/29 20:24:36 UTC

[PR] Fix equality operation for Geometry subclasses [cassandra-java-driver]

absurdfarce opened a new pull request, #2093:
URL: https://github.com/apache/cassandra-java-driver/pull/2093

   Wondering if I got this wrong in my [earlier change](https://github.com/apache/cassandra-java-driver/pull/2077), trying to do some testing to confirm.


-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] Fix equality operation for Geometry subclasses [cassandra-java-driver]

Posted by "absurdfarce (via GitHub)" <gi...@apache.org>.
absurdfarce commented on PR #2093:
URL: https://github.com/apache/cassandra-java-driver/pull/2093#issuecomment-5521253482

   Note: this change will probably wind up being reverted.  See CASSJAVA-136 for all the gory details.


-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] Fix equality operation for Geometry subclasses [cassandra-java-driver]

Posted by "absurdfarce (via GitHub)" <gi...@apache.org>.
absurdfarce commented on code in PR #2093:
URL: https://github.com/apache/cassandra-java-driver/pull/2093#discussion_r3546938510


##########
core/src/main/java/com/datastax/dse/driver/internal/core/data/geometry/DefaultGeometry.java:
##########
@@ -176,7 +176,7 @@ public boolean equals(Object o) {
       return false;
     }
     DefaultGeometry that = (DefaultGeometry) o;
-    return this.getOgcGeometry().equals((Object) that.getOgcGeometry());
+    return this.getOgcGeometry().Equals(that.getOgcGeometry());

Review Comment:
   I'm becoming increasingly convinced that the [earlier change](https://github.com/apache/cassandra-java-driver/pull/2077) was indeed incorrect.  Prior to that update we were doing the following for DefaultGeometry.equals():
   
   `return this.getOgcGeometry().equals(that.getOgcGeometry());`
   
   That leverages the [equals(OGCGeometry)](https://github.com/Esri/geometry-api-java/blob/v1.2.1/src/main/java/com/esri/core/geometry/ogc/OGCGeometry.java#L213-L222) method in ESRI 1.2.1.  ESRI 2.2.4 introduced an [equals(Object)](https://github.com/Esri/geometry-api-java/blob/v2.2.4/src/main/java/com/esri/core/geometry/ogc/OGCGeometry.java#L809-L841) impl in the PR referenced elsewhere but the meaning is different from the old equals() impl.  The old implementation has been moved to [Equals(OGCGeometry)](https://github.com/Esri/geometry-api-java/blob/v2.2.4/src/main/java/com/esri/core/geometry/ogc/OGCGeometry.java#L250-L269) in 2.2.4... that's what we should have moved to originally (and what this PR does move us to). 



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] Fix equality operation for Geometry subclasses [cassandra-java-driver]

Posted by "absurdfarce (via GitHub)" <gi...@apache.org>.
absurdfarce commented on PR #2093:
URL: https://github.com/apache/cassandra-java-driver/pull/2093#issuecomment-4918794866

   I'm actually not super-concerned about that @hiSandog for reasons [cited in the code itself](https://github.com/apache/cassandra-java-driver/blob/4.19.3/core/src/main/java/com/datastax/dse/driver/internal/core/data/geometry/DefaultGeometry.java#L182-L190).  We use ESRI Geometry objects for hashCode() which will keep us consistent so long as we use those same objects for equality comparisons.


-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] Fix equality operation for Geometry subclasses [cassandra-java-driver]

Posted by "hiSandog (via GitHub)" <gi...@apache.org>.
hiSandog commented on PR #2093:
URL: https://github.com/apache/cassandra-java-driver/pull/2093#issuecomment-4849794269

   For the geometry equality fix, it would be useful to cover `hashCode` and cross-subclass comparisons in the same test area. Equality bugs often reappear when two subclasses share identical coordinates but should not compare equal as domain types. A null/empty geometry case would also help document the intended behavior.
   


-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] Fix equality operation for Geometry subclasses [cassandra-java-driver]

Posted by "absurdfarce (via GitHub)" <gi...@apache.org>.
absurdfarce merged PR #2093:
URL: https://github.com/apache/cassandra-java-driver/pull/2093


-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org