Skip to content

Commit db04059

Browse files
committed
Test for reproducing issue #121
1 parent 78d3833 commit db04059

File tree

1 file changed

+13
-1
lines changed
  • end-to-end-tests/src/test/java/net/orfjackal/retrolambda/test

1 file changed

+13
-1
lines changed

end-to-end-tests/src/test/java/net/orfjackal/retrolambda/test/LambdaTest.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import net.orfjackal.retrolambda.test.anotherpackage.DifferentPackageBase;
88
import org.apache.commons.lang.SystemUtils;
9-
import org.junit.Test;
9+
import org.junit.*;
1010
import org.objectweb.asm.*;
1111
import org.objectweb.asm.Type;
1212

@@ -247,6 +247,18 @@ private static String privateClassMethod() {
247247
return "foo";
248248
}
249249

250+
251+
@Test
252+
@Ignore // TODO: fix issue #121
253+
public void enclosing_method_of_anonymous_class_inside_lambda_expression() throws Exception {
254+
Callable<Object> lambda = () -> new Object() {
255+
};
256+
Class<?> anonymousClass = lambda.call().getClass();
257+
258+
assertThat(anonymousClass.getEnclosingMethod().getName(),
259+
startsWith("lambda$enclosing_method_of_anonymous_class_inside_lambda_expression$"));
260+
}
261+
250262
/**
251263
* We could make private lambda implementation methods package-private,
252264
* so that the lambda class may call them, but we should not make any

0 commit comments

Comments
 (0)