From 6b0816c1c4f7f608e9ecc597131fd0d975ab3c98 Mon Sep 17 00:00:00 2001 From: Daniel Holle Date: Mon, 8 Apr 2024 14:02:57 +0200 Subject: [PATCH] Add test for #309 --- resources/bytecode/javFiles/Bug309.jav | 13 +++++++++++++ src/test/java/TestComplete.java | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100644 resources/bytecode/javFiles/Bug309.jav 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");