introduce functional variable: encode this (IDEA-174203)

This commit is contained in:
Anna Kozlova
2017-06-09 15:52:28 +03:00
parent 404fe68c03
commit d0fab7fd0b
4 changed files with 31 additions and 3 deletions

View File

@@ -0,0 +1,9 @@
import java.util.function.Function;
class Test {
String string;
void useThis() {
Function<String, String> stringStringFunction = string -> string;
System.out.println(stringStringFunction.apply(string));
}
}

View File

@@ -0,0 +1,6 @@
class Test {
String string;
void useThis() {
System.out.println(<selection>this.string</selection>);
}
}

View File

@@ -67,6 +67,10 @@ public class IntroduceFunctionalVariableTest extends LightRefactoringTestCase {
doTest();
}
public void testChangeContextBeforePuttingIntoAnonymous() throws Exception {
doTest();
}
public void testIgnoreMethodObjectSuggestion() throws Exception {
try {
doTest();