mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
method refs: rename in case of constructor refs fixed
This commit is contained in:
+1
-1
@@ -115,7 +115,7 @@ public class PsiMethodReferenceExpressionImpl extends PsiReferenceExpressionBase
|
||||
final IElementType elType = child.getElementType();
|
||||
if (elType == JavaTokenType.DOUBLE_COLON) {
|
||||
return ChildRole.DOUBLE_COLON;
|
||||
} else if (elType == JavaTokenType.IDENTIFIER) {
|
||||
} else if (elType == JavaTokenType.IDENTIFIER || elType == JavaElementType.REFERENCE_EXPRESSION) {
|
||||
return ChildRole.REFERENCE_NAME;
|
||||
}
|
||||
return ChildRole.EXPRESSION;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
public class FooBar {
|
||||
private static final class B<caret>ar {
|
||||
private Bar() {
|
||||
}
|
||||
}
|
||||
|
||||
private interface I<T> {
|
||||
T create();
|
||||
}
|
||||
|
||||
static void foo(I intf) {}
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
foo(Bar::new);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
public class FooBar {
|
||||
private static final class Bar1 {
|
||||
private Bar1() {
|
||||
}
|
||||
}
|
||||
|
||||
private interface I<T> {
|
||||
T create();
|
||||
}
|
||||
|
||||
static void foo(I intf) {}
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
foo(Bar1::new);
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,10 @@ public class RenameLocalTest extends LightRefactoringTestCase {
|
||||
doTest("_i");
|
||||
}
|
||||
|
||||
public void testClassNameUsedInMethodRefs() throws Exception {
|
||||
doTest("Bar1");
|
||||
}
|
||||
|
||||
public void testRenameParamUniqueName() throws Exception {
|
||||
configureByFile(BASE_PATH + getTestName(false) + ".java");
|
||||
PsiElement element = TargetElementUtilBase
|
||||
|
||||
Reference in New Issue
Block a user