Merge branch 'targetBytecode' of https://gitea.hb.dhbw-stuttgart.de/JavaTX/JavaCompilerCore into targetBytecode
This commit is contained in:
commit
3d2b935c60
13
resources/bytecode/javFiles/Bug325.jav
Normal file
13
resources/bytecode/javFiles/Bug325.jav
Normal file
@ -0,0 +1,13 @@
|
||||
import java.lang.Integer;
|
||||
import java.util.function.Function;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Bug325 {
|
||||
public main() {
|
||||
List<Integer> list = new ArrayList<>(List.of(1,2,3,4,5));
|
||||
var func = x -> x*2;
|
||||
return list.stream().map(func).toList();
|
||||
}
|
||||
}
|
@ -1085,6 +1085,13 @@ public class TestComplete {
|
||||
var res = clazz.getDeclaredMethod("convert", List.class).invoke(instance, list);
|
||||
assertEquals(res, List.of(6, 7, 8));
|
||||
}
|
||||
@Test
|
||||
public void testBug325() throws Exception {
|
||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug325.jav");
|
||||
var clazz = classFiles.get("Bug325");
|
||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
||||
clazz.getDeclaredMethod("main").invoke(instance);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBug326() throws Exception {
|
||||
|
Loading…
Reference in New Issue
Block a user