You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by "Alyssa Kim (JIRA)" <ji...@apache.org> on 2017/03/31 03:33:42 UTC
[jira] [Comment Edited] (GEODE-1577) Unhelpful generic types on
Execution.execute
[ https://issues.apache.org/jira/browse/GEODE-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15950270#comment-15950270 ]
Alyssa Kim edited comment on GEODE-1577 at 3/31/17 3:33 AM:
------------------------------------------------------------
https://github.com/apache/geode/pull/321
-Reverted the changes made before
-Added argument types.
Let me know and assign it back to me if there is any problem. It's been a while so I might have missed something.
Thank you for the code-review!
was (Author: dalyssakim):
https://github.com/apache/geode/pull/321
-Reverted the changes made before
-Added argument types.
Let me know if there is any problem. It's been a while so I might have missed something.
Thank you for the code-review!
> Unhelpful generic types on Execution.execute
> --------------------------------------------
>
> Key: GEODE-1577
> URL: https://issues.apache.org/jira/browse/GEODE-1577
> 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
(v6.3.15#6346)