You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2017/08/08 15:23:32 UTC
tinkerpop git commit: Fixed a bug in `RangeByIsCountStrategy`.
Repository: tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1742 [created] fde3aeb32
Fixed a bug in `RangeByIsCountStrategy`.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/fde3aeb3
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/fde3aeb3
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/fde3aeb3
Branch: refs/heads/TINKERPOP-1742
Commit: fde3aeb3235ea4d15f39982d836c9fb0f9f3ad53
Parents: 14f0318
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Tue Aug 8 08:23:06 2017 -0700
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Tue Aug 8 08:23:06 2017 -0700
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
.../strategy/optimization/RangeByIsCountStrategy.java | 8 +++-----
.../strategy/optimization/RangeByIsCountStrategyTest.java | 1 +
3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fde3aeb3/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 803f3b2..1eeeb00 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -28,6 +28,7 @@ TinkerPop 3.2.6 (Release Date: NOT OFFICIALLY RELEASED YET)
This release also includes changes from <<release-3-1-8, 3.1.8>>.
+* Fixed a bug in `RangeByIsCountStrategy`.
* Allowed access to `InjectStep.injections` for `TraversalStrategy` analysis.
* Exceptions that occur during result iteration in Gremlin Server will now return `SCRIPT_EVALUATION_EXCEPTION` rather than `SERVER_ERROR`.
* `AddEdgeStep` attaches detached vertices prior to edge creation.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fde3aeb3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategy.java
index b0cdb39..85e5753 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategy.java
@@ -27,10 +27,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
import org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.NotStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.RangeGlobalStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.*;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountGlobalStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchStep;
@@ -138,7 +135,8 @@ public final class RangeByIsCountStrategy extends AbstractTraversalStrategy<Trav
traversal.asAdmin().removeStep(curr); // CountStep
size -= 2;
if (!dismissCountIs) {
- if (traversal.getParent() instanceof FilterStep) {
+ final TraversalParent p;
+ if ((p = traversal.getParent()) instanceof FilterStep && !(p instanceof ConnectiveStep)) {
final Step<?, ?> filterStep = parent.asStep();
final Traversal.Admin parentTraversal = filterStep.getTraversal();
final Step notStep = new NotStep<>(parentTraversal,
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fde3aeb3/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategyTest.java
index 9f3b97d..a721878 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategyTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategyTest.java
@@ -95,6 +95,7 @@ public class RangeByIsCountStrategyTest {
{__.filter(__.bothE().count().is(gte(1))), __.filter(__.bothE())},
{__.filter(__.bothE().count().is(gt(1))), __.filter(__.bothE().limit(2).count().is(gt(1)))},
{__.filter(__.bothE().count().is(gte(2))), __.filter(__.bothE().limit(2).count().is(gte(2)))},
+ {__.and(__.out().count().is(0), __.in().count().is(0)), __.and(__.not(__.out()), __.not(__.in()))}
});
}