diff --git a/resources/bytecode/javFiles/Bug309.jav b/resources/bytecode/javFiles/Bug309.jav new file mode 100644 index 00000000..d37fc7a1 --- /dev/null +++ b/resources/bytecode/javFiles/Bug309.jav @@ -0,0 +1,13 @@ +import java.util.List; +import java.util.ArrayList; +import java.lang.Integer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.function.Function; + +public class Bug309 { + public main() { + List list = new ArrayList<>(List.of(1,2,3,4,5,6,7,8,9)); + list.stream().map(x -> x * 2); + } +} diff --git a/src/test/java/TestComplete.java b/src/test/java/TestComplete.java index d6c90703..d98627b5 100644 --- a/src/test/java/TestComplete.java +++ b/src/test/java/TestComplete.java @@ -1032,6 +1032,15 @@ public class TestComplete { clazz.getDeclaredMethod("main").invoke(instance); } + @Test + @Ignore("This hangs") + public void testBug309() throws Exception { + var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug309.jav"); + var clazz = classFiles.get("Bug309"); + var instance = clazz.getDeclaredConstructor().newInstance(); + clazz.getDeclaredMethod("main").invoke(instance); + } + @Test public void testBug310() throws Exception { var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug310.jav");