mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
IDEA-119052 Java smart type code completion proposes incorrect variant if non-matching local variable hides a matching instance variable
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import java.util.Collection;
|
||||
|
||||
class A {
|
||||
String join(Collection<String> strings) {
|
||||
return StringUtil.join(strings, ",");
|
||||
}
|
||||
|
||||
void method(Collection<String> param) {
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String[] param = {""}; // hides the parameter
|
||||
Collection<String> params = Arrays.asList(param);
|
||||
join(params)<caret>
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import java.util.Collection;
|
||||
|
||||
class A {
|
||||
String join(Collection<String> strings) {
|
||||
return StringUtil.join(strings, ",");
|
||||
}
|
||||
|
||||
void method(Collection<String> param) {
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String[] param = {""}; // hides the parameter
|
||||
Collection<String> params = Arrays.asList(param);
|
||||
join(<caret>)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -994,6 +994,8 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
|
||||
public void testCaseMissingEnumValue() throws Throwable { doTest(); }
|
||||
public void testCaseMissingEnumValue2() throws Throwable { doTest(); }
|
||||
|
||||
public void testNoHiddenParameter() { doTest(); }
|
||||
|
||||
public void testTypeVariableInstanceOf() throws Throwable {
|
||||
configureByTestName();
|
||||
@@ -1106,7 +1108,7 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
complete();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
private void doTest() {
|
||||
doTest(Lookup.NORMAL_SELECT_CHAR);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user