Merge branch 'targetBytecode' of gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into targetBytecode

This commit is contained in:
pl@gohorb.ba-horb.de 2023-11-03 20:26:41 +01:00
commit 44f8899157
3 changed files with 5 additions and 2 deletions

0
resources/bytecode/javFiles/Cycle.class Normal file → Executable file
View File

View File

@ -1,13 +1,16 @@
import java.lang.Runnable; import java.lang.Runnable;
import java.lang.String; import java.lang.String;
import java.lang.System; import java.lang.System;
import java.io.PrintStream;
public class LambdaRunnable { public class LambdaRunnable {
public LambdaRunnable(){ public LambdaRunnable(){
Runnable lam = () -> {var a;}; Runnable lam = () -> {
System.out.println("Runnable is running");
};
lam.run(); lam.run();
} }
} }

View File

@ -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);