You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2017/08/08 16:27:03 UTC

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

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1743 1e04d928a -> db91ffffd


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

Branch: refs/heads/TINKERPOP-1743
Commit: db91ffffd0e5f41c50223c1bce526e7096def3fe
Parents: 1e04d92
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Aug 8 10:27:00 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Aug 8 10:27:00 2017 -0600

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


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/db91ffff/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);
+            }
         }
     }