realized the restriction can be specific to $ or @ and thus, less checking 
needs to be done on lambda toString().


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

Branch: refs/heads/master
Commit: b4463a9f5e54ee79f53eb112489f2107854ef5a2
Parents: 839dd61
Author: Marko A. Rodriguez <okramma...@gmail.com>
Authored: Tue Aug 8 10:27:00 2017 -0600
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Aug 9 07:11:21 2017 -0400

----------------------------------------------------------------------
 .../strategy/verification/LambdaRestrictionStrategy.java  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b4463a9f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategy.java
----------------------------------------------------------------------
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategy.java
index 1b925ca..33b29ff 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategy.java
@@ -61,12 +61,16 @@ public final class LambdaRestrictionStrategy extends 
AbstractTraversalStrategy<T
                 throw new VerificationException("The provided traversal 
contains a lambda step: " + step, traversal);
             if (step instanceof ComparatorHolder) {
                 for (final Pair<Traversal.Admin<Object, Comparable>, 
Comparator<Comparable>> comparator : ((ComparatorHolder<Object, Comparable>) 
step).getComparators()) {
-                    if (comparator.toString().contains("$$Lambda$"))
+                    final String comparatorString = comparator.toString();
+                    if (comparatorString.contains("$") || 
comparatorString.contains("@"))
                         throw new VerificationException("The provided step 
contains a lambda comparator: " + step, traversal);
                 }
             }
-            if (step instanceof SackValueStep && (((SackValueStep) 
step).getSackFunction().toString().contains("$$Lambda$")))
-                throw new VerificationException("The provided step contains a 
lambda comparator: " + step, traversal);
+            if (step instanceof SackValueStep) {
+                final String sackString = ((SackValueStep) 
step).getSackFunction().toString();
+                if (sackString.contains("$") || sackString.contains("@"))
+                    throw new VerificationException("The provided step 
contains a lambda bi-function: " + step, traversal);
+            }
         }
     }
 

Reply via email to