mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
variable incomplete code searcher should not find methods with the same name even if they are also unresolved; inline covered by RefactoringUtil.renameVariableReferences() (IDEA-126312)
This commit is contained in:
+1
@@ -54,6 +54,7 @@ public class VariableInIncompleteCodeSearcher extends QueryExecutorBase<PsiRefer
|
||||
if (element instanceof PsiJavaCodeReferenceElement) {
|
||||
final PsiJavaCodeReferenceElement ref = (PsiJavaCodeReferenceElement)element;
|
||||
if (!ref.isQualified() && name.equals(ref.getText()) &&
|
||||
!(ref.getParent() instanceof PsiMethodCallExpression) &&
|
||||
ref.resolve() == null && ref.advancedResolve(true).getElement() == refElement) {
|
||||
consumer.process(ref);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
public boolean isConsideredFinal(int cl) {
|
||||
return haveSeenAllExp<caret>ectedAtCl(cl);
|
||||
}
|
||||
|
||||
private boolean haveSeenAllExpectedAtCl(int cl) {
|
||||
return cl == cl();
|
||||
}
|
||||
|
||||
int cl() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Test {
|
||||
public boolean isConsideredFinal(int cl) {
|
||||
return cl == cl();
|
||||
}
|
||||
|
||||
int cl() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -264,6 +264,10 @@ public class InlineMethodTest extends LightRefactoringTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSameVarMethodNames() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTestInlineThisOnly() {
|
||||
@NonNls String fileName = "/refactoring/inlineMethod/" + getTestName(false) + ".java";
|
||||
configureByFile(fileName);
|
||||
|
||||
Reference in New Issue
Block a user