tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [44/49] tinkerpop git commit: TINKERPOP-786 Improved flexbility of handling __ for DSLs in java
Date Fri, 26 May 2017 12:55:54 GMT
TINKERPOP-786 Improved flexbility of handling __ for DSLs in java


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

Branch: refs/heads/TINKERPOP-1618
Commit: d6b0122b55ebaf4fc91c3c0a0139ca72984a1834
Parents: 651c1c6
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Fri May 26 07:26:30 2017 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Fri May 26 07:26:30 2017 -0400

----------------------------------------------------------------------
 .../gremlin/process/traversal/dsl/GremlinDslProcessor.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d6b0122b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDslProcessor.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDslProcessor.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDslProcessor.java
index 5088d21..470dd4b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDslProcessor.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDslProcessor.java
@@ -178,7 +178,12 @@ public class GremlinDslProcessor extends AbstractProcessor {
                 methodToAdd.varargs(true);
                 methodToAdd.addStatement("return inject(starts)", methodName);
             } else {
-                addMethodBody(methodToAdd, templateMethod, "return __.<A>start().$L(",
")", methodName);
+                if (templateMethod.getTypeParameters().isEmpty()) {
+                    final List<? extends TypeMirror> types = getTypeArguments(templateMethod);
+                    addMethodBody(methodToAdd, templateMethod, "return __.<$T>start().$L(",
")", types.get(0), methodName);
+                } else {
+                    addMethodBody(methodToAdd, templateMethod, "return __.<A>start().$L(",
")", methodName);
+                }
             }
 
             anonymousClass.addMethod(methodToAdd.build());


Mime
View raw message