added @dkuppitz tweak to remove stream() usage.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/189b1bc8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/189b1bc8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/189b1bc8 Branch: refs/heads/tp32 Commit: 189b1bc81a04c62032247f6ba984cf5e58b173b7 Parents: 651367b Author: Marko A. Rodriguez <okramma...@gmail.com> Authored: Wed Aug 30 08:59:30 2017 -0600 Committer: Marko A. Rodriguez <okramma...@gmail.com> Committed: Wed Aug 30 08:59:30 2017 -0600 ---------------------------------------------------------------------- .../gremlin/process/traversal/step/map/MatchStep.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/189b1bc8/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 ed6014a..dfe52b0 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 @@ -514,10 +514,14 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>> if (null != this.selectKey) this.scopeKeys.add(this.selectKey); final Set<String> endLabels = ((MatchStep<?, ?>) this.getTraversal().getParent()).getMatchEndLabels(); - Stream.concat( - TraversalHelper.getStepsOfAssignableClassRecursively(WherePredicateStep.class, this.getTraversal()).stream(), - TraversalHelper.getStepsOfAssignableClassRecursively(WhereTraversalStep.class, this.getTraversal()).stream()). - flatMap(s -> s.getScopeKeys().stream()).filter(endLabels::contains).forEach(this.scopeKeys::add); + TraversalHelper.anyStepRecursively(step -> { + if (step instanceof WherePredicateStep || step instanceof WhereTraversalStep) { + for (final String key : ((Scoping) step).getScopeKeys()) { + if (endLabels.contains(key)) this.scopeKeys.add(key); + } + } + return false; + }, this.getTraversal()); // this is the old way but it only checked for where() as the next step, not arbitrarily throughout traversal // just going to keep this in case something pops up in the future and this is needed as an original reference. /* if (this.getNextStep() instanceof WhereTraversalStep || this.getNextStep() instanceof WherePredicateStep)