This is an automated email from the ASF dual-hosted git repository.

colegreer pushed a commit to branch gvalue-feature-tests
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit b45972d699da707956c8e7b0b0650f431227c445
Author: Cole-Greer <[email protected]>
AuthorDate: Sun Nov 24 14:15:49 2024 -0800

    Update Function Traverser Equality and HashCode
    
    Update equality and hashcode to be determined by the equality/hashcode
    of it's underlying function. This is to address a bug such that 2
    instances of a ChooseStep which utilize identical choice functions, will
    not be considered equal as each step instance is refering to a distinct
    FunctionTraverser object.
---
 .../gremlin/process/traversal/lambda/FunctionTraverser.java    | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/FunctionTraverser.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/FunctionTraverser.java
index 92179788b6..1fdef27efa 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/FunctionTraverser.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/FunctionTraverser.java
@@ -43,4 +43,14 @@ public final class FunctionTraverser<A, B> implements 
Function<Traverser<A>, B>,
     public String toString() {
         return this.function.toString();
     }
+
+    @Override
+    public boolean equals(final Object other) {
+        return other != null && other.getClass().equals(this.getClass()) && 
this.hashCode() == other.hashCode();
+    }
+
+    @Override
+    public int hashCode() {
+        return this.function.hashCode();
+    }
 }

Reply via email to