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 2016/01/12 22:53:42 UTC

incubator-tinkerpop git commit: Groovy was selecting the wrong method for the by()-modulation. I had this problem before with Column. A simple fix -- TINKERPOP-1060

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 4054e2678 -> 44ba97572


Groovy was selecting the wrong method for the by()-modulation. I had this problem before with Column. A simple fix -- TINKERPOP-1060


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

Branch: refs/heads/master
Commit: 44ba97572305baa3de888ac14b9b0a81b5537be4
Parents: 4054e26
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Jan 12 14:53:39 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Jan 12 14:53:39 2016 -0700

----------------------------------------------------------------------
 .../gremlin/process/traversal/dsl/graph/GraphTraversal.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/44ba9757/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 5dd963c..488298f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@ -1176,7 +1176,9 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     }
 
     public default <V> GraphTraversal<S, E> by(final Function<V, Object> functionProjection) {
-        return this.by(__.map(new FunctionTraverser<>(functionProjection)));
+        return functionProjection instanceof T ?
+                this.by((T) functionProjection) :
+                this.by(__.map(new FunctionTraverser<>(functionProjection)));
     }
 
     public default GraphTraversal<S, E> by(final T tokenProjection) {