From db04059b971fa53f7746fba3ec43c5383d00dd0b Mon Sep 17 00:00:00 2001 From: Esko Luontola Date: Thu, 26 Jan 2017 23:26:51 +0200 Subject: [PATCH] Test for reproducing issue #121 --- .../net/orfjackal/retrolambda/test/LambdaTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/end-to-end-tests/src/test/java/net/orfjackal/retrolambda/test/LambdaTest.java b/end-to-end-tests/src/test/java/net/orfjackal/retrolambda/test/LambdaTest.java index 2e976543..07b1384f 100644 --- a/end-to-end-tests/src/test/java/net/orfjackal/retrolambda/test/LambdaTest.java +++ b/end-to-end-tests/src/test/java/net/orfjackal/retrolambda/test/LambdaTest.java @@ -6,7 +6,7 @@ import net.orfjackal.retrolambda.test.anotherpackage.DifferentPackageBase; import org.apache.commons.lang.SystemUtils; -import org.junit.Test; +import org.junit.*; import org.objectweb.asm.*; import org.objectweb.asm.Type; @@ -247,6 +247,18 @@ private static String privateClassMethod() { return "foo"; } + + @Test + @Ignore // TODO: fix issue #121 + public void enclosing_method_of_anonymous_class_inside_lambda_expression() throws Exception { + Callable lambda = () -> new Object() { + }; + Class anonymousClass = lambda.call().getClass(); + + assertThat(anonymousClass.getEnclosingMethod().getName(), + startsWith("lambda$enclosing_method_of_anonymous_class_inside_lambda_expression$")); + } + /** * We could make private lambda implementation methods package-private, * so that the lambda class may call them, but we should not make any