forked from JavaTX/JavaCompilerCore
modified: Cycle.class
modified: LambdaRunnable.jav modified: ../../../src/test/java/TestComplete.java
This commit is contained in:
parent
c51190feef
commit
e0da2a4c46
0
resources/bytecode/javFiles/Cycle.class
Normal file → Executable file
0
resources/bytecode/javFiles/Cycle.class
Normal file → Executable file
@ -6,9 +6,9 @@ public class LamRunnable{
|
|||||||
|
|
||||||
public LamRunnable(){
|
public LamRunnable(){
|
||||||
|
|
||||||
|
Runnable lam;
|
||||||
Runnable lam = () -> {var a;};
|
lam = () -> {var a;};
|
||||||
lam.run();
|
//lam.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -740,7 +740,7 @@ public class TestComplete {
|
|||||||
@Test
|
@Test
|
||||||
public void testLambdaRunnable() throws Exception {
|
public void testLambdaRunnable() throws Exception {
|
||||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "LambdaRunnable.jav");
|
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "LambdaRunnable.jav");
|
||||||
var clazz = classFiles.get("LambdaRunnable");
|
var clazz = classFiles.get("LamRunnable");
|
||||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
var instance = clazz.getDeclaredConstructor().newInstance();
|
||||||
//var m = clazz.getDeclaredMethod("m", Integer.class);
|
//var m = clazz.getDeclaredMethod("m", Integer.class);
|
||||||
//assertEquals(m.invoke(instance, 10), 60);
|
//assertEquals(m.invoke(instance, 10), 60);
|
||||||
@ -751,8 +751,8 @@ public class TestComplete {
|
|||||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "FunctionalInterface.jav");
|
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "FunctionalInterface.jav");
|
||||||
var clazz = classFiles.get("FunctionalInterface");
|
var clazz = classFiles.get("FunctionalInterface");
|
||||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
var instance = clazz.getDeclaredConstructor().newInstance();
|
||||||
var m = clazz.getDeclaredMethod("m", Integer.class);
|
var m = clazz.getDeclaredMethod("m");
|
||||||
assertEquals(m.invoke(instance, 20), 400);
|
assertEquals(m.invoke(instance), 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user