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/19 00:03:54 UTC

incubator-tinkerpop git commit: MatchStartStep and MatchEndStep are not static inner classes as cloning() and inner classes still reference the original 'this'. Scary. To be safe, made them static as well as ComputerAwareStep.EndStep which is used by Rep

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master ab0d2f242 -> cc5db9239


MatchStartStep and MatchEndStep are not static inner classes as cloning() and inner classes still reference the original 'this'. Scary. To be safe, made them static as well as ComputerAwareStep.EndStep which is used by RepeatStep, BranchStep, UnionStep, etc.


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

Branch: refs/heads/master
Commit: cc5db9239830c71a890aec428161d86b5113abf2
Parents: ab0d2f2
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Jun 18 16:03:50 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Jun 18 16:03:50 2015 -0600

----------------------------------------------------------------------
 .../gremlin/process/traversal/step/map/MatchStep.java          | 6 +++---
 .../gremlin/process/traversal/step/util/ComputerAwareStep.java | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc5db923/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 23fca2f..31196b6 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
@@ -297,7 +297,7 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
 
     //////////////////////////////
 
-    public class MatchStartStep extends AbstractStep<Object, Object> implements Scoping {
+    public static class MatchStartStep extends AbstractStep<Object, Object> implements Scoping {
 
         private final String selectKey;
         private Set<String> scopeKeys = null;
@@ -359,7 +359,7 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
         }
     }
 
-    public class MatchEndStep extends EndStep {
+    public static class MatchEndStep extends EndStep<Object> {
 
         private final String matchKey;
 
@@ -369,7 +369,7 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
         }
 
         @Override
-        protected Traverser<S> processNextStart() throws NoSuchElementException {
+        protected Traverser<Object> processNextStart() throws NoSuchElementException {
             while (true) {
                 final Traverser.Admin traverser = this.starts.next();
                 // no end label

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc5db923/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ComputerAwareStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ComputerAwareStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ComputerAwareStep.java
index 4c819f2..a8cc2d3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ComputerAwareStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ComputerAwareStep.java
@@ -66,7 +66,7 @@ public abstract class ComputerAwareStep<S, E> extends AbstractStep<S, E> impleme
 
     //////
 
-    public class EndStep extends AbstractStep<S, S> implements EngineDependent {
+    public static class EndStep<S> extends AbstractStep<S, S> implements EngineDependent {
 
         public EndStep(final Traversal.Admin traversal) {
             super(traversal);
@@ -76,7 +76,7 @@ public abstract class ComputerAwareStep<S, E> extends AbstractStep<S, E> impleme
         protected Traverser<S> processNextStart() throws NoSuchElementException {
             final Traverser.Admin<S> start = this.starts.next();
             if (this.traverserStepIdSetByChild)
-                start.setStepId(ComputerAwareStep.this.getNextStep().getId());
+                start.setStepId(((ComputerAwareStep)this.getTraversal().getParent()).getNextStep().getId());
             return start;
         }