From f2e43f180c33e618fc52f7224807cdb8bb72b36a Mon Sep 17 00:00:00 2001 From: Daniel Holle Date: Mon, 4 Mar 2024 11:51:28 +0100 Subject: [PATCH] Add test for issue #125 --- resources/bytecode/javFiles/Bug125.jav | 16 ++++++++++++++++ src/test/java/TestComplete.java | 7 +++++++ 2 files changed, 23 insertions(+) create mode 100644 resources/bytecode/javFiles/Bug125.jav diff --git a/resources/bytecode/javFiles/Bug125.jav b/resources/bytecode/javFiles/Bug125.jav new file mode 100644 index 00000000..26474ae2 --- /dev/null +++ b/resources/bytecode/javFiles/Bug125.jav @@ -0,0 +1,16 @@ +import java.lang.Boolean; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.LinkedList; +import java.util.ArrayList; + +class Bug125 { + static ArrayList works = new ArrayList<>(); + static List fails = new ArrayList<>(); + + void main() { + works.toString(); + fails.toString(); + } +} diff --git a/src/test/java/TestComplete.java b/src/test/java/TestComplete.java index e188ee37..572b6a67 100644 --- a/src/test/java/TestComplete.java +++ b/src/test/java/TestComplete.java @@ -855,4 +855,11 @@ public class TestComplete { var clazz = classFiles.get("Bug123"); var instance = clazz.getDeclaredConstructor().newInstance(); } + + @Test + public void testBug125() throws Exception { + var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug125.jav"); + var clazz = classFiles.get("Bug125"); + var instance = clazz.getDeclaredConstructor().newInstance(); + } }