You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2015/06/29 21:29:09 UTC

incubator-tinkerpop git commit: fixed up the hashCode() definitions to be like how @dkuppitz does them.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master cd334a0e1 -> dd91d94f1


fixed up the hashCode() definitions to be like how @dkuppitz does them.


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

Branch: refs/heads/master
Commit: dd91d94f18efda2ebeab4f7ad993d652593d5ccf
Parents: cd334a0
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jun 29 13:29:15 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Jun 29 13:29:15 2015 -0600

----------------------------------------------------------------------
 .../process/traversal/step/map/MatchStep.java   | 21 +++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/dd91d94f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
index 3a58a29..3782ae1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
@@ -23,7 +23,6 @@ package org.apache.tinkerpop.gremlin.process.traversal.step.map;
 
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
 import org.apache.tinkerpop.gremlin.process.traversal.Pop;
-import org.apache.tinkerpop.gremlin.process.traversal.Scope;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
@@ -88,7 +87,7 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
         this.matchTraversals = (List) Stream.of(matchTraversals).map(Traversal::asAdmin).collect(Collectors.toList());
         this.matchTraversals.forEach(this::configureStartAndEndSteps); // recursively convert to MatchStep, MatchStartStep, or MatchEndStep
         this.matchTraversals.forEach(this::integrateChild);
-        this.computedStartLabel =  Helper.computeStartLabel(this.matchTraversals);
+        this.computedStartLabel = Helper.computeStartLabel(this.matchTraversals);
     }
 
     //////////////////
@@ -230,9 +229,9 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
         }
     }
 
-    public boolean isDeduping() {
+    /*public boolean isDeduping() {
         return this.dedupLabels != null;
-    }
+    }*/
 
     private boolean isDuplicate(final Traverser<S> traverser) {
         if (null == this.dedups)
@@ -312,7 +311,7 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
                 traverser = this.starts.next();
                 final Path path = traverser.path();
                 if (!this.matchStartLabels.stream().filter(path::hasLabel).findAny().isPresent())
-                        path.addLabel(this.computedStartLabel); // if the traverser doesn't have a legal start, then provide it the pre-computed one
+                    path.addLabel(this.computedStartLabel); // if the traverser doesn't have a legal start, then provide it the pre-computed one
                 path.addLabel(this.getId()); // so the traverser never returns to this branch ever again
             }
             ///
@@ -401,7 +400,10 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
 
         @Override
         public int hashCode() {
-            return super.hashCode() ^ (null == this.selectKey ? "null".hashCode() : this.selectKey.hashCode());
+            int result = super.hashCode();
+            if (null != this.selectKey)
+                result ^= this.selectKey.hashCode();
+            return result;
         }
 
         public Optional<String> getSelectKey() {
@@ -466,7 +468,10 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
 
         @Override
         public int hashCode() {
-            return super.hashCode() ^ (null == this.matchKey ? "null".hashCode() : this.matchKey.hashCode());
+            int result = super.hashCode();
+            if (null != this.matchKey)
+                result ^= this.matchKey.hashCode();
+            return result;
         }
     }
 
@@ -642,6 +647,4 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
             }
         }
     }
-
-
 }