new file: applyLambdaTest.java
modified: javFiles/Lambda.jav new file: javFiles/applyLambda.jav An das JavaTXExamples angepasst
This commit is contained in:
parent
d373b3dbf8
commit
2a5c727400
23
test/bytecode/applyLambdaTest.java
Normal file
23
test/bytecode/applyLambdaTest.java
Normal file
@ -0,0 +1,23 @@
|
||||
package bytecode;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.dhbwstuttgart.core.JavaTXCompiler;
|
||||
|
||||
public class applyLambdaTest {
|
||||
private static String path;
|
||||
private static File fileToTest;
|
||||
private static JavaTXCompiler compiler;
|
||||
|
||||
@Test
|
||||
public void generateBC() throws Exception {
|
||||
path = System.getProperty("user.dir")+"/test/bytecode/javFiles/applyLambda.jav";
|
||||
fileToTest = new File(path);
|
||||
compiler = new JavaTXCompiler(fileToTest);
|
||||
compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,16 +1,11 @@
|
||||
import java.util.Vector;
|
||||
class Apply { }
|
||||
import java.lang.Integer;
|
||||
|
||||
public class Lambda {
|
||||
|
||||
m () {
|
||||
var lam1 = (x) -> {
|
||||
return x;
|
||||
var lam1 = (Integer x) -> {
|
||||
return x * x;
|
||||
};
|
||||
|
||||
return lam1.apply(new Apply());
|
||||
//return lam1;
|
||||
// return new Vector();
|
||||
return lam1;
|
||||
}
|
||||
}
|
||||
|
||||
|
16
test/bytecode/javFiles/applyLambda.jav
Normal file
16
test/bytecode/javFiles/applyLambda.jav
Normal file
@ -0,0 +1,16 @@
|
||||
import java.util.Vector;
|
||||
class Apply { }
|
||||
|
||||
public class applyLambda {
|
||||
|
||||
m () {
|
||||
var lam1 = (x) -> {
|
||||
return x;
|
||||
};
|
||||
|
||||
return lam1.apply(new Apply());
|
||||
//return lam1;
|
||||
//return new Vector();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user