Skip to content

Instantly share code, notes, and snippets.

@Bill
Created June 17, 2019 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bill/5e2ad2ba4b60461dd0af8adfa4adc91b to your computer and use it in GitHub Desktop.
Save Bill/5e2ad2ba4b60461dd0af8adfa4adc91b to your computer and use it in GitHub Desktop.
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