tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject tinkerpop git commit: OrderedTraverser needs a equals() and hashCode().
Date Wed, 18 Jan 2017 14:47:00 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1564 6a1f014b7 -> 1178ba1bf


OrderedTraverser needs a equals() and hashCode().


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1178ba1b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1178ba1b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1178ba1b

Branch: refs/heads/TINKERPOP-1564
Commit: 1178ba1bf43dbcae2d667efaa4fd1ef44460c5b1
Parents: 6a1f014
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Wed Jan 18 07:46:54 2017 -0700
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Wed Jan 18 07:46:54 2017 -0700

----------------------------------------------------------------------
 .../traversal/traverser/util/OrderedTraverser.java      | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1178ba1b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/OrderedTraverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/OrderedTraverser.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/OrderedTraverser.java
index b85a18b..92c6256 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/OrderedTraverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/OrderedTraverser.java
@@ -178,7 +178,17 @@ public final class OrderedTraverser<T> implements Traverser.Admin<T>
{
     }
 
     @Override
-    public Traverser<T> clone() {
+    public int hashCode() {
+        return this.internal.hashCode();
+    }
+
+    @Override
+    public boolean equals(final Object object) {
+        return object instanceof OrderedTraverser && ((OrderedTraverser) object).internal.equals(this.internal);
+    }
+
+    @Override
+    public OrderedTraverser<T> clone() {
         try {
             final OrderedTraverser<T> clone = (OrderedTraverser<T>) super.clone();
             clone.internal = (Traverser.Admin<T>) this.internal.clone();


Mime
View raw message