Created
June 17, 2019 22:34
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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