[1/2] tinkerpop git commit: Fixed a bug in `RangeByIsCountStrategy` that led to unexpected behaviors when predicates were used with floating point numbers.

2017-09-26 Thread dkuppitz
Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 40f93dd8f -> e5a1bb500


Fixed a bug in `RangeByIsCountStrategy` that led to unexpected behaviors when 
predicates were used with floating point numbers.


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

Branch: refs/heads/tp32
Commit: 568ba08419774d990069bdc3be674bddf32ec4d5
Parents: 40f93dd
Author: Daniel Kuppitz 
Authored: Wed Sep 13 14:08:07 2017 -0700
Committer: Daniel Kuppitz 
Committed: Tue Sep 26 10:20:37 2017 -0700

--
 .../strategy/optimization/RangeByIsCountStrategy.java | 10 +-
 .../strategy/optimization/RangeByIsCountStrategyTest.java |  3 +++
 2 files changed, 12 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/568ba084/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 85e5753..2c55093 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
@@ -31,6 +31,7 @@ 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;
+import 
org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.IdentityStep;
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep;
 import 
org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
@@ -94,7 +95,7 @@ public final class RangeByIsCountStrategy extends 
AbstractTraversalStrategy highRange;
 if (update) {
 if (parent instanceof EmptyStep) {
@@ -164,6 +165,13 @@ public final class RangeByIsCountStrategy extends 
AbstractTraversalStrategy(traversal, inner));
 }
+} else if (size == 0) {
+final Step parentStep = 
traversal.getParent().asStep();
+if (!(parentStep instanceof EmptyStep)) {
+final Traversal.Admin parentTraversal = 
parentStep.getTraversal();
+//parentTraversal.removeStep(parentStep); // 
this leads to IndexOutOfBoundsExceptions
+TraversalHelper.replaceStep(parentStep, new 
IdentityStep<>(parentTraversal), parentTraversal);
+}
 }
 } else {
 TraversalHelper.insertBeforeStep(new 
RangeGlobalStep<>(traversal, 0L, highRange), curr, traversal);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/568ba084/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 8767989..856420f 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
@@ -99,6 +99,9 @@ public class RangeByIsCountStrategyTest {
 {__.and(__.out().count().is(0), __.in().count().is(1)), 
__.and(__.not(__.out()), __.in().limit(2).count().is(1))},
 {__.and(__.out().count().is(1), __.in().count().is(0)), 
__.and(__.out().limit(2).count().is(1), __.not(__.in()))},
 {__.or(__.out().count().is(0), __.in().count().is(0)), 
__.or(__.not(__.out()), __.not(__.in()))},
+{__.path().filter(__.count().is(gte(0.5))).limi

[1/2] tinkerpop git commit: Fixed a bug in `RangeByIsCountStrategy`.

2017-08-11 Thread dkuppitz
Repository: tinkerpop
Updated Branches:
  refs/heads/master 392ada68b -> 4023d74cc


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/628d7082
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/628d7082
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/628d7082

Branch: refs/heads/master
Commit: 628d708264428f920a7be9064fd5a21539539911
Parents: e96ed0c
Author: Daniel Kuppitz 
Authored: Tue Aug 8 08:23:06 2017 -0700
Committer: Daniel Kuppitz 
Committed: Fri Aug 11 06:32:17 2017 -0700

--
 CHANGELOG.asciidoc   | 1 +
 .../strategy/optimization/RangeByIsCountStrategy.java| 8 +++-
 .../strategy/optimization/RangeByIsCountStrategyTest.java| 4 
 3 files changed, 8 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/628d7082/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 5809c26..85ce5c6 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -30,6 +30,7 @@ This release also includes changes from <>.
 
 * Registered `HashMap$TreeNode` to Gryo.
 * Fixed a lambda-leak in `SackValueStep` where `BiFunction` must be tested for 
true lambda status.
+* Fixed a bug in `RangeByIsCountStrategy` that broke any `ConnectiveStep` that 
included a child traversal with an optimizable pattern.
 * 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/628d7082/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 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/628d7082/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..8767989 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,10 @@ public class RangeByIsCountStrategyTest {
 {__.filter(__.bothE().count().is(gte(1))), 
__.filter(__.bothE(

[1/2] tinkerpop git commit: Fixed a bug in `RangeByIsCountStrategy`.

2017-08-11 Thread dkuppitz
Repository: tinkerpop
Updated Branches:
  refs/heads/master 21a454b2b -> 392ada68b


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/36bd2a24
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/36bd2a24
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/36bd2a24

Branch: refs/heads/master
Commit: 36bd2a2447529371d950b2df6de36ea49957ab55
Parents: 4d1e12c
Author: Daniel Kuppitz 
Authored: Tue Aug 8 08:23:06 2017 -0700
Committer: Daniel Kuppitz 
Committed: Fri Aug 11 06:22:57 2017 -0700

--
 CHANGELOG.asciidoc   | 1 +
 .../traversal/strategy/optimization/CountStrategy.java   | 8 +++-
 .../traversal/strategy/optimization/CountStrategyTest.java   | 4 
 3 files changed, 8 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/36bd2a24/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 4bb894d..b7b2717 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -145,6 +145,7 @@ This release also includes changes from <>.
 
 * Registered `HashMap$TreeNode` to Gryo.
 * Fixed a lambda-leak in `SackValueStep` where `BiFunction` must be tested for 
true lambda status.
+* Fixed a bug in `RangeByIsCountStrategy` that broke any `ConnectiveStep` that 
included a child traversal with an optimizable pattern.
 * 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/36bd2a24/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategy.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategy.java
index ecddd2c..a6fa06d 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategy.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 CountStrategy extends 
AbstractTraversalStrategy 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/36bd2a24/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategyTest.java
index 8408c07..ee4ce38 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategyTest.java
@@ -95,6 +95,10 @@ public class CountStrategyTest {
 {__.filter(__.bothE().count().is(gte(1))), 
__.filter(__.bothE())},
 {__.filter(__.bothE().count().is(gt(1))), 
__.filter(__.bothE().limit(2).count().is(