diff --git a/resources/bytecode/javFiles/LamRunnable.jav b/resources/bytecode/javFiles/LamRunnable.jav index 451858f2..d0da84cc 100644 --- a/resources/bytecode/javFiles/LamRunnable.jav +++ b/resources/bytecode/javFiles/LamRunnable.jav @@ -1,8 +1,15 @@ -public class LamRunnable{ +import java.lang.Runnable; +import java.lang.System; +import java.lang.String; +import java.io.PrintStream; + +public class LamRunnable { + + public LamRunnable() { + Runnable lam = () -> { + System.out.println("lambda"); + }; - public LamRunnable(){ - - Runnable lam = () -> {System.out.println("lambda");}; lam.run(); } } diff --git a/src/test/java/TestComplete.java b/src/test/java/TestComplete.java index 572b6a67..e671b5dc 100644 --- a/src/test/java/TestComplete.java +++ b/src/test/java/TestComplete.java @@ -842,6 +842,13 @@ public class TestComplete { var instance = clazz.getDeclaredConstructor().newInstance(); } + @Test + public void testLamRunnable() throws Exception { + var classFiles = generateClassFiles(new ByteArrayClassLoader(), "LamRunnable.jav"); + var clazz = classFiles.get("LamRunnable"); + var instance = clazz.getDeclaredConstructor().newInstance(); + } + @Test public void testBug122() throws Exception { var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug122.jav");