You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "stephen mallette (JIRA)" <ji...@apache.org> on 2017/04/26 17:44:04 UTC

[jira] [Updated] (TINKERPOP-1670) End type lost when using promise()

     [ https://issues.apache.org/jira/browse/TINKERPOP-1670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stephen mallette updated TINKERPOP-1670:
----------------------------------------
    Component/s: process

> End type lost when using promise()
> ----------------------------------
>
>                 Key: TINKERPOP-1670
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1670
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.2.4
>            Reporter: Andy Tolbert
>
> The {{Traversal.promise}} method loses type information when used so the type of the returned future is not as complete as it could be.
> For example:
> {code:java}
> g.V().hasLabel("person").has("name", "marko").promise(Traversal::next);
> {code}
> Returns a {{CompletableFuture<Object>}} instead of {{CompletableFuture<Vertex>}}.
> {code:java}
> g.V().hasLabel("person").promise(Traversal::toList);
> {code}
> Returns a {{CompletableFuture<List>}} instead of {{CompletableFuture<List<Vertex>}}.
> The fix for this could be as simple as adding the start and end (S,E) types to the traversal that is the input of the function:
> {code:java}
> public default <T> CompletableFuture<T> promise(final Function<Traversal, T> traversalFunction)
> {code}
> to:
> {code:java}
> public default <T> CompletableFuture<T> promise(final Function<Traversal<S,E>, T> traversalFunction)
> {code}
> Need to test this a bit more though, but I think that should work.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)