]> source.dussan.org Git - dcevm.git/commitdiff
Try to used serializable lambdas to force compiler to generate stable names
authorIvan Dubrov <idubrov@guidewire.com>
Fri, 2 May 2014 15:05:22 +0000 (08:05 -0700)
committerIvan Dubrov <idubrov@guidewire.com>
Fri, 2 May 2014 15:05:22 +0000 (08:05 -0700)
dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA.java
dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA___1.java
dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaTest.java
dcevm/src/test/java8/com/github/dcevm/test/lambdas/SerializableCallable.java [new file with mode: 0644]

index 670cf8b7d80f5209716055b15a18102c8d5c2a2f..758a796a2f831017d13b7db201b4331cc3c1685d 100644 (file)
@@ -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;
     }
 }
index 37697150de7aac9cbe14791a7296fcbd922f8814..03f5d018b2d0ecc2bdfb565028685095d6d80f8d 100644 (file)
@@ -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;
     }
 }
index 685f4215dcf39f705d1b222e1f986145d7df8ccf..efacdbbc29a71b8e3adcffd62e6cf986beb3a8b9 100644 (file)
@@ -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 (file)
index 0000000..6e22c62
--- /dev/null
@@ -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 {
+}