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

package com.github.dcevm.test.lambdas; package com.github.dcevm.test.lambdas;


import java.io.Serializable;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;


public class LambdaA {
public Callable<Integer> createLambda() {
public class LambdaA implements Serializable {
public SerializableCallable<Integer> createLambda() {
return () -> 10; return () -> 10;
} }


public Callable<Integer> createLambda2() {
public SerializableCallable<Integer> createLambda2() {
return () -> 20; return () -> 20;
} }
} }

+ 4
- 3
dcevm/src/test/java8/com/github/dcevm/test/lambdas/LambdaA___1.java View File

package com.github.dcevm.test.lambdas; package com.github.dcevm.test.lambdas;


import java.io.Serializable;
import java.util.concurrent.Callable; 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; return () -> 30;
} }


public Callable<Integer> createLambda2() {
public SerializableCallable<Integer> createLambda2() {
return () -> 40; return () -> 40;
} }
} }

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

} }


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

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

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