encode qualifiers in method refs (IDEA-145512)

This commit is contained in:
Anna Kozlova
2015-09-25 13:53:43 +03:00
parent b29779ed87
commit d9403ffcb7
6 changed files with 44 additions and 3 deletions
@@ -0,0 +1,9 @@
import java.util.Map;
import java.util.Set;
public class Bar {
void bar() {
Function<Map.Entry<Long, Set<Integer>>, Long> getKey = Map.Entry::getKey;
}
}
@@ -0,0 +1,7 @@
import java.util.Map.Entry;
import java.util.Set;
import java.util.function.Function;
class Foo {
}
@@ -0,0 +1,5 @@
public class Bar {
void bar() {
Foo.foo();
}
}
@@ -0,0 +1,12 @@
import java.util.Map.Entry;
import java.util.Set;
import java.util.function.Function;
class Foo {
public static void foo() {
Function<Entry<Long, Set<Integer>>, Long> getKey = Entry::getKey;
}
}
@@ -46,6 +46,10 @@ public class InlineMethodMultifileTest extends RefactoringTestCase {
doTest("Foo", "foo");
}
public void testDecodeQualifierInMethodReference() throws Exception {
doTest("Foo", "foo");
}
private void doTest(String className, String methodName) throws Exception {
String rootBefore = getRoot() + "/before";
PsiTestUtil.removeAllRoots(myModule, IdeaTestUtil.getMockJdk17());