Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 d288c53bf -> 2d7113aaa


TINKERPOP-1890 getAnonymousTraversalClass() is now generated by the DSL 
processor CTR


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

Branch: refs/heads/tp32
Commit: 2d7113aaa166b69a8503be27aebf36a8063b82bd
Parents: d288c53
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Feb 14 10:07:41 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Feb 14 10:08:35 2018 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                             | 1 +
 .../gremlin/process/traversal/dsl/GremlinDslProcessor.java     | 6 ++++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d7113aa/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 9dcb7f0..f1519b6 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -23,6 +23,7 @@ 
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 [[release-3-2-8]]
 === TinkerPop 3.2.8 (Release Date: NOT OFFICIALLY RELEASED YET)
 
+* Modified `GremlinDslProcessor` so that it generated the 
`getAnonymousTraversalClass()` method to return the DSL version of `__`.
 * Added the "Kitchen Sink" test data set.
 * Fixed a bug in `NumberHelper` that led to wrong min/max results if numbers 
exceeded the Integer limits.
 * Delayed setting of the request identifier until `RequestMessage` 
construction by the builder.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d7113aa/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 cdfad6a..ec6379f 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
@@ -297,6 +297,12 @@ public class GremlinDslProcessor extends AbstractProcessor 
{
                     .addStatement("return ($T) traversal.asAdmin().addStep(new 
$T(traversal, $T.class, true, edgeIds))", ctx.traversalClassName, 
GraphStep.class, Edge.class)
                     .returns(ParameterizedTypeName.get(ctx.traversalClassName, 
ClassName.get(Edge.class), ClassName.get(Edge.class)))
                     .build());
+            
traversalSourceClass.addMethod(MethodSpec.methodBuilder("getAnonymousTraversalClass")
+                    .addModifiers(Modifier.PUBLIC)
+                    .addAnnotation(Override.class)
+                    .addStatement("return Optional.of(__.class)")
+                    .returns(ParameterizedTypeName.get(Optional.class, 
Class.class))
+                    .build());
         }
 
         final JavaFile traversalSourceJavaFile = 
JavaFile.builder(ctx.packageName, traversalSourceClass.build()).build();

Reply via email to