[
https://issues.apache.org/jira/browse/TINKERPOP-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16144392#comment-16144392
]
ASF GitHub Bot commented on TINKERPOP-1759:
-------------------------------------------
Github user okram commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/699#discussion_r135642938
--- Diff:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_O_S_SE_SL_Traverser.java
---
@@ -110,17 +112,22 @@ public void merge(final Traverser.Admin<?> other) {
/////////////////
+ final boolean carriesUnmergeableSack() {
+ // hmmm... serialization in OLAP destroys the transient sideEffects
+ return null != this.sack && (null == this.sideEffects || null ==
this.sideEffects.getSackMerger());
+ }
+
@Override
public int hashCode() {
- return this.t.hashCode() + this.future.hashCode() + this.loops;
+ return carriesUnmergeableSack() ? System.identityHashCode(this) :
(super.hashCode() ^ this.loops);
+ }
+
+ protected final boolean equals(final B_O_S_SE_SL_Traverser other) {
--- End diff --
I'm a little scared of this "double equals()" definition. @spmallette -- do
you have any thoughts on this matter? Note that there is an `equals(Object)`
method like always, but then there is this added `protected final
equals(SpecificClass)`. I have a feeling that this could get screwy for
languages like Groovy. Perhaps there is a better way to do what is needed
without overloading `equals()`?
> Improve hashcode and equals for Traverser implementations
> ---------------------------------------------------------
>
> Key: TINKERPOP-1759
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1759
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.2.6
> Reporter: Daniel Kuppitz
> Assignee: Daniel Kuppitz
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)