geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <>
Subject [jira] [Commented] (GEODE-1577) Unhelpful generic types on Execution.execute
Date Thu, 13 Apr 2017 17:18:42 GMT


ASF subversion and git services commented on GEODE-1577:

Commit bd40bcac75aa61b128849d68b88cd8df08b40f3e in geode's branch refs/heads/feature/GEODE-2632
from [~huynhja]
[;h=bd40bca ]

GEODE-1577: modified MultiRegionFunctionExecutor to fix compilation error

> Unhelpful generic types on Execution.execute
> --------------------------------------------
>                 Key: GEODE-1577
>                 URL:
>             Project: Geode
>          Issue Type: Bug
>          Components: functions
>            Reporter: Dan Smith
> The execute methods of the function service Execution class returns a ResultCollector
with wildcards for the type.
> {code}  
> public ResultCollector<?, ?> execute(
>       Function function) throws FunctionException;
> {code}
> Wildcards are supposed to be used in APIs where the type doesn't matter, for example
counting the elements in a list. By returning a ResultCollector with wildcards, we're essentially
forcing the user to cast the result collector.
> At a minimum they should be able to pick the type of result collector
> {code}
>   public <T,S> ResultCollector<T, S> execute(
>       Function function) throws FunctionException;
> {code}
> But maybe it would make more sense to parameterize Execution itself. Then the compiler
could ensure that the types used by withCollector and the types used by execute match.

This message was sent by Atlassian JIRA

View raw message