Compare commits

...

2 Commits

Author SHA1 Message Date
662756ac18 Merge branch 'targetBytecode' of https://gitea.hb.dhbw-stuttgart.de/JavaTX/JavaCompilerCore into targetBytecode
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 5m26s
2024-05-10 16:51:10 +02:00
b0bf41968e Bug325 2024-05-10 16:50:06 +02:00
2 changed files with 20 additions and 0 deletions

View 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();
}
}

View File

@ -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 {