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 2017/12/01 19:25:23 UTC
[2/2] tinkerpop git commit: TINKERPOP-1846 Fixed bug in
LambdaRestrictionStrategy
TINKERPOP-1846 Fixed bug in LambdaRestrictionStrategy
Traversals using Lambda scripts were not triggering this strategy. The strategy expected the word "lambda" in the toString() of the step that held it. Lambda objects weren't including that word.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b99585a5
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b99585a5
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b99585a5
Branch: refs/heads/TINKERPOP-1846
Commit: b99585a564d1fc095440ce949f462bc036e4bb64
Parents: 270b4db
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Nov 30 09:26:51 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Dec 1 14:25:08 2017 -0500
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
.../java/org/apache/tinkerpop/gremlin/util/function/Lambda.java | 2 +-
.../strategy/verification/LambdaRestrictionStrategyTest.java | 3 +++
3 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b99585a5/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index a45ca8a..2f1a5c6 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -27,6 +27,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
* Documented the recommended method for constructing DSLs with Gremlin.Net.
* Provided a method to configure detachment options with `EventStrategy`.
* Fixed a race condition in `TinkerIndex`.
+* Fixed bug in `LambdaRestrictionStrategy` where traversals using `Lambda` scripts weren't causing the strategy to trigger.
* Improved error messaging for bytecode deserialization errors in Gremlin Server.
* Fixed an `ArrayOutOfBoundsException` in `hasId()` for the rare situation when the provided collection is empty.
* Bump to Netty 4.0.53
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b99585a5/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/function/Lambda.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/function/Lambda.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/function/Lambda.java
index a259eb3..1031156 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/function/Lambda.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/function/Lambda.java
@@ -66,7 +66,7 @@ public interface Lambda extends Serializable {
@Override
public String toString() {
- return this.lambdaSource;
+ return "lambda[" + this.lambdaSource + "]";
}
@Override
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b99585a5/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategyTest.java
index 767211c..b79d2c9 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategyTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategyTest.java
@@ -29,6 +29,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrat
import org.apache.tinkerpop.gremlin.structure.Column;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.util.function.Lambda;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@@ -50,6 +51,8 @@ public class LambdaRestrictionStrategyTest {
@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][]{
+ {"map(Lambda.function('true')}", __.map(Lambda.function("true")), false},
+ {"filter(Lambda.predicate('true')}", __.filter(Lambda.predicate("true")), false},
{"filter(x->true)", __.filter(x -> true), false},
{"map(Traverser::get)", __.map(Traverser::get), false},
{"sideEffect(x -> {int i = 1+1;})", __.sideEffect(x -> {