Skip to content

Instantly share code, notes, and snippets.

@Bill Bill/scratch_38.java
Created Jun 17, 2019

Embed
What would you like to do?
I don't think the changes to genericize Execution does what we want https://github.com/apache/geode/pull/3715
import java.math.BigInteger;
import java.util.Collections;
import org.apache.geode.cache.execute.Execution;
import org.apache.geode.cache.execute.FunctionService;
class Scratch {
public static void main(String[] args) {
final Execution<String, String, String> execution = FunctionService.onRegion(null);
//Add a string argument, which appears to be typesafe
final Execution<String, String, String> addedArgument = execution.setArguments("hello");
//But wait! If we call withFilter, we get to change the type of Execution with no warning
//or casts. We won't see the class cast exceptions until runtime.
final Execution<Integer, Integer, Integer> execution1 = execution.withFilter(Collections.singleton(5));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.