Community
Participate
Working Groups
Consider the example below: @FunctionalInterface public interface I1 { int foo(int a); } class X { void foo() { I1 i1= (int a) -> {return 10;}; // Extract lambda expr I1 i2= (a) -> {return 10;}; // Extract lambda expr bar(a -> 10); // Extract lambda expr } void bar(I1 i) { } // expected method after extraction I1 m() { return (int a) -> {return 10;}; } } Try to extract only the lambda expr from the lines with comments to a method using Alt+Shift+M. We get different error messages in above cases and it is not possible to extract the lambda expr to a method as shown in the expected method above.
The same is applicable to Extract Local Variable refactoring. It is not possible to extract the lambda expr to a local variable using Alt+Shift+L. Example - Same as comment #0.
(In reply to comment #1) > The same is applicable to Extract Local Variable refactoring. > It is not possible to extract the lambda expr to a local variable using > Alt+Shift+L. > Example - Same as comment #0. Created bug 416264 for Extract Local Variable refactoring.
This will be fixed along with the patch for bug 407985.
(In reply to Noopur Gupta from comment #3) > This will be fixed along with the patch for bug 407985. Fixed with bug 407985.
Verified the functionality in bug 407985 using Kepler SR2 + Java 8 RC1 + Eclipse Java Development Tools Patch for Java 8 Support (BETA) 1.0.0.v20140220-2054