[ https://issues.apache.org/jira/browse/GEODE-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15839125#comment-15839125 ]
Alyssa Kim commented on GEODE-1577: ----------------------------------- If the goal is to avoid using generic types, I think it's better to introduce a new class as suggested above and refactor all the previous methods with generics to be type specific. Once we have release after release and the code becomes even more ginormous, the pain to refactor (if someone decides to do it) and clean up will be much greater than now... I think. {code} public Execution withFilter(Set<?> filter); /* not 100% sure about this */ public Execution withArgs(Object args); public Execution withCollector(ResultCollector<?, ?> rc); public ResultCollector<?, ?> execute(String functionId) throws FunctionException; {code} I would take the pain if that makes the code better :) ! Thanks for the feedback. I will wait for others' opinion and see what happens. > 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: Dan Smith > 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)