[ https://issues.apache.org/jira/browse/GEODE-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15756181#comment-15756181 ]
ASF GitHub Bot commented on GEODE-1577: --------------------------------------- GitHub user micro9110 opened a pull request: https://github.com/apache/geode/pull/321 [GEODE-1577] Unhelpful generic types on Execution.execute 1. Replaced the execute methods of the function service Execution class returning a ResultCollector with wildcards with generic types. 2. Modified the related classes using this method with explicit type casting to use the method with generic type. JIRA https://issues.apache.org/jira/browse/GEODE-1577 You can merge this pull request into a Git repository by running: $ git pull https://github.com/micro9110/incubator-geode feature/GEODE-1577 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/geode/pull/321.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 #321 ---- commit 4b480710b01081cc4eb2911392ad6f0c3da86cbb Author: Alyssa Kim <micro9...@gmail.com> Date: 2016-12-13T02:49:25Z GEODE-1577: Unhelpful generic types on Execution.execute Replaced wildcards with <T, S> for non-deprecated Execution.execute methods. commit d70a0e3f3cf558bd4e2828c118382eaea465fc77 Author: Alyssa Kim <micro9...@gmail.com> Date: 2016-12-17T02:31:31Z GEODE-1577: Unhelpful generic types on Execution.execute Fixed Execute.execute in classes that use this method to Execute.<T, S>execute, and removed explicit casting. ---- > 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 > Assignee: Alyssa Kim > Labels: starter > > 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.4#6332)