Github user upthewaterspout commented on the issue:
https://github.com/apache/geode/pull/321
Hi all,
I'm really sorry I missed this. I was out of town for a while and somehow
the discussion slipped through the cracks when I was catching up.
These changes are what I had in mind, but I didn't realize that this would
break existing code that was doing a cast. I know adding a generics should be
safe, but in this case we're fixing generics that are broken which is why I
think we are getting into trouble.
I did a little messing around. It looks like we might be able to get away
with adding generics to Execution.
The only caveat is that once we add generics to Execution we are stuck with
them. There is an existing bug to also add an argument type to the
FunctionContext - see GEODE-2217. So I think maybe the thing to do is to add
three types parameters to execution. Something like this:
```
/**
*
* @param <IN> The type of the argument passed into the function, if any
* @param <OUT The type of results sent by the function
* @param <AGG> The type of the aggregrated result returned by the
ResultCollector
*/
public interface Execution<IN, OUT,AGG> {
Execution<IN, OUT, AGG> withArgs(IN args);
ResultCollector<OUT, AGG> execute(...)
}
```
What do you think? The other option I suppose is to deprecate the Execution
class and introduce a new one, or deprecate the execute methods and introduce
new ones, but that seems painful.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---