diff options
author | Ivan Dubrov <idubrov@guidewire.com> | 2014-05-02 08:05:22 -0700 |
---|---|---|
committer | Ivan Dubrov <idubrov@guidewire.com> | 2014-05-02 08:05:22 -0700 |
commit | 3bb5f3c9305f6c0f9110cde5f7d9319a8e6d7d18 (patch) | |
tree | a62d89f123333e263f15a87fde7497b2ef4c1c8a /dcevm/src | |
parent | ab18a5578a1e35f58ff9f18d6d14e3ab1bc3c476 (diff) | |
download | dcevm-3bb5f3c9305f6c0f9110cde5f7d9319a8e6d7d18.tar.gz dcevm-3bb5f3c9305f6c0f9110cde5f7d9319a8e6d7d18.zip |
Try to used serializable lambdas to force compiler to generate stable names
Diffstat (limited to 'dcevm/src')
4 files changed, 18 insertions, 7 deletions
diff --git a/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA.java b/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA.java index 670cf8b7..758a796a 100644 --- a/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA.java +++ b/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA.java @@ -1,13 +1,14 @@ package com.github.dcevm.test.lambdas; +import java.io.Serializable; import java.util.concurrent.Callable; -public class LambdaA { - public Callable<Integer> createLambda() { +public class LambdaA implements Serializable { + public SerializableCallable<Integer> createLambda() { return () -> 10; } - public Callable<Integer> createLambda2() { + public SerializableCallable<Integer> createLambda2() { return () -> 20; } } diff --git a/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA___1.java b/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA___1.java index 37697150..03f5d018 100644 --- a/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA___1.java +++ b/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA___1.java @@ -1,14 +1,15 @@ package com.github.dcevm.test.lambdas; +import java.io.Serializable; import java.util.concurrent.Callable; -public class LambdaA___1 { +public class LambdaA___1 implements Serializable { - public Callable<Integer> createLambda() { + public SerializableCallable<Integer> createLambda() { return () -> 30; } - public Callable<Integer> createLambda2() { + public SerializableCallable<Integer> createLambda2() { return () -> 40; } } diff --git a/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaTest.java b/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaTest.java index 685f4215..efacdbbc 100644 --- a/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaTest.java +++ b/dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaTest.java @@ -53,7 +53,6 @@ public class LambdaTest { } @Test - @Ignore public void testMethodLambda() throws Exception { LambdaA a = new LambdaA(); Callable<Integer> lambda = a.createLambda(); diff --git a/dcevm/src/test/java8/com/github/dcevm/test/lambdas/SerializableCallable.java b/dcevm/src/test/java8/com/github/dcevm/test/lambdas/SerializableCallable.java new file mode 100644 index 00000000..6e22c626 --- /dev/null +++ b/dcevm/src/test/java8/com/github/dcevm/test/lambdas/SerializableCallable.java @@ -0,0 +1,10 @@ +package com.github.dcevm.test.lambdas; + +import java.io.Serializable; +import java.util.concurrent.Callable; + +/** + * Created by idubrov on 5/2/14. + */ +public interface SerializableCallable<T> extends Callable<T>, Serializable { +} |