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/23 03:42:04 UTC

incubator-tinkerpop git commit: removed unneeded WhereStep.variables.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 196beeed7 -> 2f12cf392


removed unneeded WhereStep.variables.


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

Branch: refs/heads/master
Commit: 2f12cf39250377d606874adc804d1ca354675b93
Parents: 196beee
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jun 22 19:42:00 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Jun 22 19:42:00 2015 -0600

----------------------------------------------------------------------
 .../gremlin/process/traversal/step/filter/WhereStep.java  | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2f12cf39/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereStep.java
index 2eb47af..659bc2c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereStep.java
@@ -55,17 +55,13 @@ public final class WhereStep<S> extends FilterStep<S> implements TraversalParent
     protected Traversal.Admin<?, ?> whereTraversal;
     protected Scope scope;
     protected final Set<String> scopeKeys = new HashSet<>();
-    protected final Set<Variable> variables = new HashSet<>();
 
     public WhereStep(final Traversal.Admin traversal, final Scope scope, final Optional<String> startKey, final P<String> predicate) {
         super(traversal);
         this.scope = scope;
         this.startKey = startKey.orElse(null);
-        if (null != this.startKey) {
+        if (null != this.startKey)
             this.scopeKeys.add(this.startKey);
-            this.variables.add(Variable.START);
-        }
-        this.variables.add(Variable.END);
         this.predicate = (P) predicate;
         this.selectKeys = new ArrayList<>();
         this.whereTraversal = null;
@@ -80,7 +76,7 @@ public final class WhereStep<S> extends FilterStep<S> implements TraversalParent
         this.selectKeys = null;
         this.whereTraversal = whereTraversal.asAdmin();
         this.configureStartAndEndSteps(this.whereTraversal);
-        if (this.variables.isEmpty())
+        if (this.scopeKeys.isEmpty())
             throw new IllegalArgumentException("A where()-traversal must have at least a start or end label (i.e. variable): " + whereTraversal);
         this.whereTraversal = this.integrateChild(this.whereTraversal);
     }
@@ -95,7 +91,6 @@ public final class WhereStep<S> extends FilterStep<S> implements TraversalParent
             final String label = startStep.getLabels().iterator().next();
             this.scopeKeys.add(label);
             TraversalHelper.replaceStep(startStep, new WhereStartStep(whereTraversal, label), whereTraversal);
-            this.variables.add(Variable.START);
         } else if (!whereTraversal.getEndStep().getLabels().isEmpty()) {                    // ...out().as("a") traversals
             TraversalHelper.insertBeforeStep(new WhereStartStep(whereTraversal, null), (Step) startStep, whereTraversal);
         }
@@ -108,7 +103,6 @@ public final class WhereStep<S> extends FilterStep<S> implements TraversalParent
             this.scopeKeys.add(label);
             endStep.removeLabel(label);
             whereTraversal.addStep(new WhereEndStep(whereTraversal, label));
-            this.variables.add(Variable.END);
         }
     }