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 2016/12/07 20:02:43 UTC

[20/50] tinkerpop git commit: @dkuppitz found a Path bug in tp32/. I added a test case to tp31/ and the bug wasn't there. I upmerged to tp32/ and the bug was exposed. The bug isn't in an official release and was introduced a ccouple of weeks ago with MAR

@dkuppitz found a Path bug in tp32/. I added a test case to tp31/ and the bug wasn't there. I upmerged to tp32/ and the bug was exposed. The bug isn't in an official release and was introduced a ccouple of weeks ago with MARKER work to IncidentToAdjacentStrategy. The fix was a one-line tweak. CTR.


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

Branch: refs/heads/TINKERPOP-1490
Commit: b84d653e46eab04c1c137972cd797b9dd6d66c8c
Parents: 1fcca95 4745fe1
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Nov 23 05:11:37 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Nov 23 05:11:37 2016 -0700

----------------------------------------------------------------------
 .../IncidentToAdjacentStrategy.java             |  4 ++-
 .../traversal/step/map/GroovyPathTest.groovy    |  5 +++
 .../process/traversal/step/map/PathTest.java    | 35 ++++++++++++++++++--
 3 files changed, 40 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b84d653e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/IncidentToAdjacentStrategy.java
----------------------------------------------------------------------
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/IncidentToAdjacentStrategy.java
index a0adbdc,712110d4..efe8618
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/IncidentToAdjacentStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/IncidentToAdjacentStrategy.java
@@@ -18,6 -18,6 +18,7 @@@
   */
  package org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization;
  
++import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.VertexProgramStep;
  import org.apache.tinkerpop.gremlin.process.traversal.Step;
  import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
  import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@@ -74,15 -69,10 +75,16 @@@ public final class IncidentToAdjacentSt
      }
  
      @Override
 -    public void apply(Traversal.Admin<?, ?> traversal) {
 -        final Traversal.Admin root = TraversalHelper.getRootTraversal(traversal);
 -        if (TraversalHelper.hasStepOfAssignableClassRecursively(INVALIDATING_STEP_CLASSES, root))
 +    public void apply(final Traversal.Admin<?, ?> traversal) {
 +        // using a hidden label marker to denote whether the traversal should not be processed by this strategy
-         if (traversal.getParent() instanceof EmptyStep && TraversalHelper.hasStepOfAssignableClassRecursively(INVALIDATING_STEP_CLASSES, traversal))
++        if ((traversal.getParent() instanceof EmptyStep || traversal.getParent() instanceof VertexProgramStep) &&
++                TraversalHelper.hasStepOfAssignableClassRecursively(INVALIDATING_STEP_CLASSES, traversal))
 +            TraversalHelper.applyTraversalRecursively(t -> t.getStartStep().addLabel(MARKER), traversal);
 +        if (traversal.getStartStep().getLabels().contains(MARKER)) {
 +            traversal.getStartStep().removeLabel(MARKER);
              return;
 +        }
 +        ////////////////////////////////////////////////////////////////////////////
          final Collection<Pair<VertexStep, Step>> stepsToReplace = new ArrayList<>();
          Step prev = null;
          for (final Step curr : traversal.getSteps()) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b84d653e/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy
----------------------------------------------------------------------
diff --cc gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy
index e696978,6caf246..15c499a
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy
@@@ -52,7 -52,12 +52,12 @@@ public abstract class GroovyPathTest 
  
          @Override
          public Traversal<Vertex, Path> get_g_V_asXaX_hasXname_markoX_asXbX_hasXage_29X_asXcX_path() {
 -            TraversalScriptHelper.compute("g.V.as('a').has('name', 'marko').as('b').has('age', 29).as('c').path", g)
 +            new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').has('name', 'marko').as('b').has('age', 29).as('c').path")
          }
+ 
+         @Override
+         public Traversal<Vertex, Path> get_g_VX1X_outEXcreatedX_inV_inE_outV_path(final Object v1Id) {
 -            TraversalScriptHelper.compute("g.V(v1Id).outE('created').inV.inE.outV.path()", g, "v1Id", v1Id)
++            new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE('created').inV.inE.outV.path()", "v1Id", v1Id)
+         }
      }
  }