Browse Source

Try to used serializable lambdas to force compiler to generate stable names

tags/light-jdk7u51+10
Ivan Dubrov 10 years ago
parent
commit
3bb5f3c930

+ 4
- 3
dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA.java View 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;
}
}

+ 4
- 3
dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA___1.java View 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;
}
}

+ 0
- 1
dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaTest.java View File

@@ -53,7 +53,6 @@ public class LambdaTest {
}

@Test
@Ignore
public void testMethodLambda() throws Exception {
LambdaA a = new LambdaA();
Callable<Integer> lambda = a.createLambda();

+ 10
- 0
dcevm/src/test/java8/com/github/dcevm/test/lambdas/SerializableCallable.java View File

@@ -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 {
}

Loading…
Cancel
Save