[ 
https://issues.apache.org/jira/browse/TINKERPOP-1791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16212614#comment-16212614
 ] 

ASF GitHub Bot commented on TINKERPOP-1791:
-------------------------------------------

GitHub user spmallette opened a pull request:

    https://github.com/apache/tinkerpop/pull/736

    TINKERPOP-1791 Added GremlinDsl.AnonymousMethod annotation

    https://issues.apache.org/jira/browse/TINKERPOP-1791
    
    Allows the ability to bypass the type inference system and provides for 
direct specification of the type parameters when generating anonymous methods.
    
    Builds with `mvn clean install`
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1791

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/736.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #736
    
----
commit daa442cd7e100a7f48541cf17bc29b17c68cb5a5
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2017-10-20T12:58:52Z

    TINKERPOP-1791 Added GremlinDsl.AnonymousMethod annotation
    
    Allows the ability to bypass the type inference system and provides for 
direct specification of the type parameters when generating anonymous methods.

----


> GremlinDsl custom step with generic end type produces invalid code in __.java
> -----------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1791
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1791
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.2.5
>            Reporter: Severin Stampler
>
> I'm trying the create a custom step to perform a full-text search in an 
> external index and return the matching vertices or edges, like this:
> {code:java}
> @GremlinDsl(traversalSource = 
> "com.saillabs.mediaminer.mmgraphdsl.MMGraphTraversalSourceDsl")
> public interface MMGraphTraversalDsl<S, E> extends GraphTraversal.Admin<S, E> 
> {
>       public default GraphTraversal<S, E> search(String field, String query) {
>               //TODO:
>               // Find vertex ids matching the search query in external index
>               
>               Set<String> vids = new HashSet<>();
>               // for now add some hardcoded vertex ids
>               vids.add("vertex1");
>               vids.add("vertex2");
>               
>         return hasId(P.within(vids));
>     }
>       
> }
> {code}
> The code seems correct in my point of view, but the generated code in the 
> __.java is not compilable. It produces this error:
> {noformat}
> [ERROR] 
> /C:/svn/start/mm/mmserver/server/mvn/mmgraphdsl/target/generated-sources/annotations/com/saillabs/mediaminer/mmgraphdsl/__.java:[41,41]
>  cannot find symbol
> [ERROR] symbol:   class E
> [ERROR] location: class com.saillabs.mediaminer.mmgraphdsl.__
> {noformat}
> The generated code is this:
> {code:java}
> public static <S> MMGraphTraversal<S, E> search(String field, String query) {
>     return __.<S>start().search(field,query);
>   }
> {code}
> I think the correct generated code should look like this:
> {code:java}
> public static <S> MMGraphTraversal<S, S> search(String field, String query) {
>     return __.<S>start().search(field,query);
>   }
> {code}
> I think it's a bug in the GremlinDsl code generator, however, I may be wrong. 
> Any help is appreciated.
> Thanks, br
> Severin



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to