From 3bb5f3c9305f6c0f9110cde5f7d9319a8e6d7d18 Mon Sep 17 00:00:00 2001 From: Ivan Dubrov Date: Fri, 2 May 2014 08:05:22 -0700 Subject: [PATCH] Try to used serializable lambdas to force compiler to generate stable names --- .../java8/com/github/dcevm/test/lambdas/LambdaA.java | 7 ++++--- .../com/github/dcevm/test/lambdas/LambdaA___1.java | 7 ++++--- .../com/github/dcevm/test/lambdas/LambdaTest.java | 1 - .../dcevm/test/lambdas/SerializableCallable.java | 10 ++++++++++ 4 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 dcevm/src/test/java8/com/github/dcevm/test/lambdas/SerializableCallable.java 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 createLambda() { +public class LambdaA implements Serializable { + public SerializableCallable createLambda() { return () -> 10; } - public Callable createLambda2() { + public SerializableCallable 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 createLambda() { + public SerializableCallable createLambda() { return () -> 30; } - public Callable createLambda2() { + public SerializableCallable 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 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 extends Callable, Serializable { +} -- 2.39.5