tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkupp...@apache.org
Subject [03/29] tinkerpop git commit: realized the restriction can be specific to $ or @ and thus, less checking needs to be done on lambda toString().
Date Fri, 11 Aug 2017 13:39:28 GMT
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/TINKERPOP-1742-master
Commit: b4463a9f5e54ee79f53eb112489f2107854ef5a2
Parents: 839dd61
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Tue Aug 8 10:27:00 2017 -0600
Committer: Stephen Mallette <spmva@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);
+            }
         }
     }
 


Mime
View raw message