You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2018/10/09 22:42:20 UTC

[tinkerpop] branch master updated: Removed verification around g.io()

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/master by this push:
     new d6b83f5  Removed verification around g.io()
d6b83f5 is described below

commit d6b83f56baa9e7df3b39ac654e02578bbfda8f1c
Author: Stephen Mallette <sp...@genoprime.com>
AuthorDate: Tue Oct 9 18:41:01 2018 -0400

    Removed verification around g.io()
    
    Seemed like a good idea at first, but it really isn't consistent with similar situations in Gremlin. For example, there is no verification error for g.V().drop().V(). CTR
---
 .../strategy/verification/StandardVerificationStrategy.java        | 7 -------
 .../strategy/verification/StandardVerificationStrategyTest.java    | 5 -----
 2 files changed, 12 deletions(-)

diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
index 7d88ed9..fc33c69 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
@@ -83,13 +83,6 @@ public final class StandardVerificationStrategy extends AbstractTraversalStrateg
         if (TraversalHelper.getStepsOfClass(ProfileSideEffectStep.class, traversal).size() > 1) {
             throw new VerificationException("The profile()-Step cannot be specified multiple times.", traversal);
         }
-
-        if (traversal.getStartStep() instanceof ReadWriting && !endStep.equals(traversal.getStartStep())) {
-            final int total = TraversalHelper.getStepsOfClass(NoneStep.class, traversal).size() +
-                    TraversalHelper.getStepsOfClass(RequirementsStep.class, traversal).size() + 1;
-            if (total != traversal.getSteps().size())
-                throw new VerificationException("The io() step must be the first and only step in the traversal - it cannot be used with other steps", traversal);
-        }
     }
 
     public static StandardVerificationStrategy instance() {
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategyTest.java
index 96a68b2..87ee021 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategyTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategyTest.java
@@ -57,11 +57,6 @@ public class StandardVerificationStrategyTest {
                 {"__.repeat(out().fold().unfold()).times(2)", repeat(out().fold().unfold()).times(2), false},
                 {"__.repeat(sum()).times(2)", repeat(sum()).times(2), false},
                 {"__.repeat(out().count())", repeat(out().count()), false},
-                {"__.io().read().V()", EmptyGraph.instance().traversal().io(file).read().V(), false},
-                {"__.io().write().V()", EmptyGraph.instance().traversal().io(file).write().V(), false},
-                // traversals that should pass verification
-                {"__.io().read()", EmptyGraph.instance().traversal().io(file).read(), true},
-                {"__.io().write()", EmptyGraph.instance().traversal().io(file).write(), true},
                 {"__.V().profile()",
                         __.V().profile(), true},
                 {"__.V().profile('metrics').cap('metrics')",