This commit is contained in:
Daniel Holle 2024-05-10 16:50:06 +02:00
parent df2ec4b1ba
commit b0bf41968e
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

@ -1084,6 +1084,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 {